Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago