Answer to Question #5711 in C++ for haruna
write a program to compute the volume of a cylindrical fuel tank. the formula required is
volume = pie r square h;
where pie is 3.142
r is the radius of the tank
h is the height of the tank
your program should have a function called computevolume
1
2011-12-20T09:36:25-0500
// Volume of a cylindrical fuel tank.cpp : Defines the entry point for the
console application.
//
#include "stdafx.h"
#include
"conio.h"
#include <iostream>
using namespace std;
double
volume;
double pie=3.14;
double computevolume(double r,double
h){
volume = pie*r*r*h;
return volume;
}
int _tmain(int argc,
_TCHAR* argv[])
{
double r;
double h;
cout<<"Enter r of
cylindrical fuel tank: ";
cin>>r;
cout<<"Enter h of
cylindrical fuel tank: ";
cin>>h;
cout<<"The volume of a
cylindrical fuel tank: "<<computevolume(r,h);
getch();
return
0;
}
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment