Question: C++ Can someone fix this code please, I keep getting errors and it is not building. This is the Assignment: Create a program that calculates

C++

Can someone fix this code please, I keep getting errors and it is not building.

This is the Assignment: Create a program that calculates the hypotenuse of a triangle, the area of a trapezoid, and the volume of a rectangle. The user must input the variables in the formulas.

Code:

#include

#include

using namespace std;

int main()

{

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

int perp,base,product;

float hypotenuse;

cout<<" - Hyptenuse 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,a,b,h;

cout<<" Length of one side : ";

cin>>a;

cout<<" Length of second side : ";

cin>>b;

cout<<" Height of trapezoid : ";

cin>>h;

Area = ((a+b)/2)*h;

cout<<" Area of trapezoid : "<

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

int l,b,h,V;

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

cin>>h;

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

cin>>l;

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

cin>>b;

V= h * l * b;

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!