Answer to Question #186566 in C++ for Andrews Seadzi

Question #186566

write a generic C++ program that will enable students to calculate the area and volume of a trapezium. The program should prompt a student to enter the values for the length of the parallel sides and is perpendicular distance between the parallel sides respectively. The program should calculate and display the area and volume of the trapezium


1
Expert's answer
2021-05-02T12:52:31-0400
#include<iostream>
using namespace std;
void main()
{
float d,a,b,area;
cout<<"enter the value of perpendicular distance";
cin>>d;
cout<<"enter the parallel sides";
cin>>a>>b;
area=((a+b)*d)/2;
cout<<"the area of trapezium is";
cout<<area;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS