65 698
Assignments Done
99,2%
Successfully Done
In October 2018

Answer to Question #5711 in C++ for haruna

Question #5711
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
Expert's answer
// 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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions