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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started