Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

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 // 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

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M91423161
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Homework Help/Study Tips

Question conduct some research on risk aversion within

Question: Conduct some research on risk aversion within healthcare. In this research-based paper, analyze what the literature presents as an acceptable level of risk within the healthcare organization. 1. Risk aversion w ...

Question theories of successful aging explain factors that

Question: Theories of successful aging explain factors that support individuals as they grow old, contributing to their ability to function. Increasing your understanding of factors that support successful aging improves ...

Assignment textbook problems create nonconformity control

Assignment: Textbook Problems: Create Nonconformity Control Charts To further your understanding and use of SPC in health services organizations, you have examined how to create variable control charts such as the c and ...

Question multicultural competenciesprior to beginning work

Question: Multicultural Competencies Prior to beginning work on this assignment, review the article Preparing culturally competent health educators: The development and evaluation of a cultural immersion service-learning ...

Project task assignmentdesign project ideasbackgroundthis

Project Task assignment Design Project Ideas Background This is the time to create project ideas. The project is a design problem that includes at least one distinct component for each member of the group. The components ...

Question a health insurance covers the costs of a variety

Question: A health insurance covers the costs of a variety of services that promote sound physical and mental health. In this assignment, you will learn the key elements of building your benefit plan. Tasks: Respond to t ...

Question in short paragraphs in one page i want you to

Question: In short paragraphs in one page I want you to answer the questions. 1- Who would you go about creating social change? 2- How would you design a social change strategy? 3- How do you would identify social change ...

Assignment instructions sources need to be less than five

Assignment Instructions: Sources need to be less than five years old and journal/scholarly articles. Use only articles that are published between 2013-2018 (except for your theory articles which will be older as you must ...

Question culturally competent nursingfor this assignment

Question: Culturally Competent Nursing For this assignment, you will interview a person from a cultural background that is different from your own. Using the twelve domains of culture from the Purnell Model, discuss the ...

Question in the example of the pin makers who each owned

Question: In the example of the pin makers who each owned specialized equipment, sales of half-finished pins between them are costly transactions. As noted in the text, each of them has market power as both buyer and sel ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As