Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ / 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started