Question
One cone has a radius of 1.3 inches and a height of 6 inches. The other has a radius of 1.6 inches and a height
One cone has a radius of 1.3 inches and a height of 6 inches. The other has a radius of 1.6 inches and a height of 3 inches. Which cone should Johnny ask for to get the most ice cream?
Develop an algorithm and create a C program that asks the user to enter the radius (in inches) and height (in inches) of the cone and then calculates and records the amount of ice cream in cubic inches using the formula below. The cone radius and height from the user aredoublevalues.
The formula for the volume of ice cream is
2 radius3 height
=3 h =2 radius3
where thevolume of the ice creamisvolume of cone + volume of half scoopin cubic inches. The resulting volume should be displayed with 2 decimal places.
Use a C constant (const) to define the double value for(PI) as 3.14159265. Then, be sure to use the symbolic name PI in your volume calculations. Also, use thepowerfunction (from the math.h library) to calculate radius2and radius3.
E.g., if the radius of the cone was 1 inches and the height of the cone was 5 inches, then the volume
of ice cream would be
which means the volume of ice cream is 5.24+2.09 = 7.33 cubic inches.
=3.141592653312 5 h =2 3.14159265 12
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