Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me with my code? Please write the code using parameters. Sample Output Enter the diameter of a sphere: 2 A sphere with
Can someone help me with my code? Please write the code using parameters.
Sample Output Enter the diameter of a sphere: 2 A sphere with diameter = 2 has radius = 1 circumference = 6.28319 surface area = 12.5664 and volume = 4.18879 Hint: If using the math library ensure to add -Im in compile line. This is done for you in the button below. A Spherical Study Write four functions to compute the following properties of a sphere given a diameter, d, which is greater than or equal to 0.0: (a.) radius r = d/2 (b.) surfaceArea = 4 X 1 X p2 (c.) circumference = id (d.) volume = 44 x r3 Write a main program that will input the diameter of a sphere, call all four functions, and print out the four results. Do not accept inputs less than 0.0. Please note parameter for each function: radius( diameter) surfaceArea( radius) circumference( diameter) volume( radius)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