Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Instructions (Please see attached for more detailed instruction's ) The included program found in main.cpp is designed to find the area of a rectangle, the area of a circle, or the volume of a...

1 answer below »

Instructions (Please see attached for more detailed instruction's)

The included program found inmain.cppis designed to find the area of a rectangle, the area of a circle, or the volume of a cylinder.

However:

  • the statements are in the incorrect order;
  • the function calls are incorrect;
  • the logical expression in the while loop is incorrect;
  • the function definitions are incorrect;
  • You may assume that the value of Ï€ =3.14159.

Rewrite the program so that it works correctly. Your program must be properly indented. (Note that the program is menu driven and allows the user to run the program as long as the user wishes.)

Format your output withsetprecision(2)to ensure the proper number of decimals for testing!

Answered Same Day Nov 06, 2021

Solution

Sathishkumar answered on Nov 07 2021
119 Votes
#include #include using namespace std;
const double PI = 3.14159;
double length;
double width;
double radius;
double height;
int choice;
double rectangle(double l, double w);
double circle(double r);
double cylinder(double bR, double h);
int main()
{
    

while (choice!=-1)
{
    cout
fixed
showpoint
setprecision(2);
    cout
"This program can calculate the area of a rectangle, "
"the area of a circle, or volume of a cylinder."
endl;
cout
"To run the program enter: "
endl;
cout
"1: To find the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here