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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!