Question
C++ help Complete the following function that takes 3 arguments of a circle : - radius (input argument) - area (output argument, to be calculated)
C++ help
Complete the following function that takes 3 arguments of a circle :
- radius (input argument)
- area (output argument, to be calculated)
- circumference (output argument, to be calculated)
All arguments are double type.
If a radius is negative, the function returns false, otherwise it returns true.
The function does only calculation, and does nothing else.
Assume that all #include are already there
// Fill in your Function prototype
bool circleAreaAndCircumference ( _______, ________, __________);
int main() {
double radius, area, circumference;
cout << "Enter a circle radius:";
cin >> radius;
bool res =____________________
if (res)
cout << "Area is " << area << endl << "Circumference is " << circumference << endl;
else
cout << "Invalid circle";
}
// Fill in your function definition
................
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