Write another method to return the perimeter

Assignment Help Other Subject
Reference no: EM13853397

Write, test, and debug a program that prompts the user for 3 sides of two triangles. Your program will be written using a Triangle class and will have 2 Triangle objects (variables/instances of the class).

You will need to write a method (member function) that saves those sides to private object variables, write another method(s) to return the side(s), write another method to return the perimeter, write another method to return the area. This means you will have a minimum of 4 methods in your program, you might have more depending on how you write the methods that save/return the sides.

Perimeter: a + b + c // triangle sides are a, b, c
Area:
#include <cmath> // you will need to include this for the square root function
sqrt(((a+b+c)/2)*(((a+b+c)/2)-a)*(((a+b+c)/2)-b)*(((a+b+c)/2)-c)); // Heron's Formula

Example program run:

This program will take the 3 sides of two triangles and calculate the perimeter and area

Please enter 3 sides of triangle 1: 16 14 10.5
Please enter 3 sides of triangle 2: 6 7.5 9

The triangle 1
with sides of 16, 14, 10.5
has a perimeter of 40.5
and has an area of 72.4185

The triangle 2
with sides of 6, 7.5, 9
has a perimeter of 22.5
and has an area of 22.3235

Reference no: EM13853397

Questions Cloud

Calculate the total income and substitution effects : Xiao-Ping has 24 hours a day to divide between work and leisure, and her boss allows her to work as many hours as she wants.  She has $8 per day of non-labor income, and she works at a job that pays $8 per hour. Her preferences over leisure time R ? ..
How a project risk management strategy may be constructed : The management of risk is proving to be one of the most difficult tasks for the project management profession. How can risk be managed effectively and who should be responsible for this task?
Explain how constraints occur in system designs : Explain how constraints occur in system designs. Identify an example of a constraint you have encountered recently in your everyday life-whether at work or shopping
A candle maker produces jar candles : 1. A candle maker produces jar candles that have a label weight of 20.4 oz. Assume that the distribution of the weights of these candles is N (21.37,0.16). Let X denote the weight of a candle selected at random from the production line.(a)  Let X bar..
Write another method to return the perimeter : Write another method to return the perimeter, write another method to return the area. This means you will have a minimum of 4 methods in your program, you might have more depending on how you write the methods that save/return the sides.
What is an autoimmune disease? : What is an autoimmune disease?
Problem solving methodologies : The mathematical problems need to show how you derived your answer and responses. While I'm looking at the final product or your final answer, I'm also watching your problem solving methodologies. It's actually more important to me than the answer it..
Effect of integration of logistics : Effect of integration of logistics and supply chain management of Maternal, Newborn and child health (MNCH) commodities at Primary Health Care service delivery points.
Create an rfp for any event of your choice : Create an RFP for any event of your choice. Make sure to include all information relevant to your event and cover all items outlined in the sample RFP in your textbook.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd