Question: Can someone do this but in C++ programing (The Triangle class) Design a class named Triangle that extends GeometricObject. The class contains the following: Three

Can someone do this but in C++ programingCan someone do this but in C++ programing (The Triangle class) Design

(The Triangle class) Design a class named Triangle that extends GeometricObject. The class contains the following: Three double data fields named side1, side2, and side3 to denote the three sides of the triangle A no-arg constructor that creates a default triangle with each side equal to 1.0 A constructor that creates a triangle with the specified side1, side2, and side3 The constant accessor functions for all three data fields A constant function named getArea() that returns the area of this triangle A constant function named getPerimeter() that returns the perimeter of this triangle Draw the UML diagram that involves the classes Triangle and GeometricObject. GeometricObject can be downloaded (header and source file) from the Moodle site. Implement the Triangle class and write a test program that prompts the user to enter the three sides of a triangle, enter a colour and enter 1 or 0 to indicate whether the triangle is filled or not. The program should create a Triangle object with these sides and set the colour and filled properties using the input. The program should then display the area, perimeter, colour, and state true or false to indicate whether it is filled or not. As an example: Note: let a, b, c be the lengths of the sides of the triangle. The area is given by: = ( )( )( ) where p is half of the perimeter (p = (a + b + c) / 2)

Tuesday, 10th March 2020 Week 12 Lab Exercises Programming Exercises 1. (The Triangle class) Design a class named Triangle that extends Geometricobject. The class contains the following: Three double data fields named side1, side2, and side3 to denote the three sides of the triangle Ano-arg constructor that creates a default triangle with each side equal to 1.0 A constructor that creates a triangle with the specified side1, side2, and side 3 The constant accessor functions for all three data fields A constant function named getArea () that returns the area of this triangle A constant function named getPerimeter() that returns the perimeter of this triangle Draw the UML diagram that involves the classes Triangle and Geometricobject. Geometricobject can be downloaded (header and source file) from the Moodle site. Implement the Triangle class and write a test program that prompts the user to enter the three sides of a triangle, enter a colour and enter 1 or 0 to indicate whether the triangle is filled or not. The program should create a Triangle object with these sides and set the colour and filled properties using the input. The program should then display the area, perimeter, colour, and state true or false to indicate whether it is filled or not. As an example: Input the lengths of the three sides of the triangle: 2.5 4.0 5.5 Enter whether the triangle is filled (1) or not (@): 1 Enter the colour of the triangle: blue You created a blue triangle of area 4.58258 and perimeter 12 Was the triangle filled? true Press any key to continue ... Note: let a, b, c be the lengths of the sides of the triangle. The area is given by: Area = P(p - a)(p - b)(p-c) where p is half of the perimeter (p = (a + b + c)/2) Tuesday, 10th March 2020 Week 12 Lab Exercises Programming Exercises 1. (The Triangle class) Design a class named Triangle that extends Geometricobject. The class contains the following: Three double data fields named side1, side2, and side3 to denote the three sides of the triangle Ano-arg constructor that creates a default triangle with each side equal to 1.0 A constructor that creates a triangle with the specified side1, side2, and side 3 The constant accessor functions for all three data fields A constant function named getArea () that returns the area of this triangle A constant function named getPerimeter() that returns the perimeter of this triangle Draw the UML diagram that involves the classes Triangle and Geometricobject. Geometricobject can be downloaded (header and source file) from the Moodle site. Implement the Triangle class and write a test program that prompts the user to enter the three sides of a triangle, enter a colour and enter 1 or 0 to indicate whether the triangle is filled or not. The program should create a Triangle object with these sides and set the colour and filled properties using the input. The program should then display the area, perimeter, colour, and state true or false to indicate whether it is filled or not. As an example: Input the lengths of the three sides of the triangle: 2.5 4.0 5.5 Enter whether the triangle is filled (1) or not (@): 1 Enter the colour of the triangle: blue You created a blue triangle of area 4.58258 and perimeter 12 Was the triangle filled? true Press any key to continue ... Note: let a, b, c be the lengths of the sides of the triangle. The area is given by: Area = P(p - a)(p - b)(p-c) where p is half of the perimeter (p = (a + b + c)/2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!