Question: / / Lab 1 0 - 1 . cpp - circle calculations / / Created / revised by on #include #include using namespace std; /
Labcpp circle calculations
Createdrevised by on
#include
#include
using namespace std;
function prototypes
void displayChoices;
void getAreadouble rad, double &area;
void getDiameterdouble rad, double &diameter;
int main
int choice ;
double radius ;
double circleArea ;
double circleDiameter ;
displayChoices;
cout "Enter your choice or : ;
cin choice;
if choice choice
cout "Invalid choice" endl;
else
cout "Radius: ;
cin radius;
if choice
getArearadius circleArea;
cout "Area: circleArea;
else
getDiameterradius circleDiameter;
cout "Diameter: circleDiameter;
end if
cout endl;
end if
return ;
end of main function
function definitions
void displayChoices
cout Circle area" endl;
cout Circle diameter" endl;
end displayChoices
void getAreadouble rad, double &area
const double PI ;
area PI powrad;
end getArea function
void getDiameterdouble rad, double &diameter
diameter rad;
end getDiameter function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
