Question: C++ Please Convert Assignment 0 to utilize a class structure in portable .h and .cpp files Exit the program only on user demand. Assignment 0:

C++ Please

Convert Assignment 0 to utilize a class structure in portable .h and .cpp files

Exit the program only on user demand.

Assignment 0:

#include

#include

using namespace std;

int main()

{

//----- Hypotenuse of a triangle -----

int perp,base,product;

float hypotenuse;

cout<<" - Hypotenuse of a triangle - ";

cout<<" Enter the length of the base : ";

cin>>base;

cout<<" Enter the length of perpendicular : ";

cin>>perp;

product= pow(perp,2) + pow(base,2);

hypotenuse = pow(product, 0.5) ;

cout<<" Hypotenuse : "<

//---- Area Of Trapezoid -----

int area,at,bt,ht;

cout<<" Length of one side : ";

cin>>at;

cout<<" Length of second side : ";

cin>>bt;

cout<<" Height of trapezoid : ";

cin>>ht;

area = (

(at+bt)/2)*ht;

cout<<" Area of trapezoid : "<

//------ Area of Rectangle -----

int lr,br,hr,vr;

cout<<" Enter height of solid rectangle : ";

cin>>hr;

cout<<" Enter length of solid rectangle : ";

cin>>lr;

cout<<" Enter width of solid rectangle : ";

cin>>br;

vr= hr * lr * br;

cout<<" Volume of the solid rectangle "<

return 0;

}

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!