Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program, circle.cpp, that inputs double radius of circle. It should print for given this radius, the circumference of the circle, the area of
Write a program, circle.cpp, that inputs double radius of circle. It should print for given this radius, the circumference of the circle, the area of the circle, the surface area of a sphere with that radius and the area of a sphere with that radius. Here are the formulas for computation: circumference 2 . ? . r Circle Area . r2 Sphere Surface Area 4 . ? . Sphere Volume4/3.t - r* Define a constant for t before main in your program const double pi 3.14159265358; You are required to write functions that do the following compute and return the circumference of a circle given the radius (parameter) compute and return the area of a circle given the radius (parameter) compute and return the sphere surface area given the radius (parameter) compute and return the sphere area given the radius (parameter) print the results given the values of the circumference, area, surface, and volume (four parameters, no return value) A sample run might be (user input in bold) Enter a radius: 7.5 Circumference Sphere Surface ...706.858 47.124 Sphere Volume 1767.146 The output should follow the format shown above (values printed with 3 digits after the decimal, in a field width of 10 characters)
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