Question: * This is for CS 101 Java class. I CANNOT USE arrays. * a. Create a new project Lab06a. Write a Java program that computes

* This is for CS 101 Java class. I CANNOT USE arrays. *

* This is for CS 101 Java class. I CANNOT USE arrays.

a. Create a new project Lab06a. Write a Java program that computes the volume of one slice of a birthday cake. The program first inputs two integers from the user, the radius of the cake (r) and the height of the cake (h). The program will compute and output the volume of a slice, based on the number of people (n) Repeatedly ask the user the number of people and calculate the volume of a slice until the user enters 0 Your program must include a static method that computes and returns the volume of one slice (double) given the height and radius of the cake and the number of people as parameters The volume of a cylinder is calculated using the following formula Hint: Math class has a constant 'Math.Pl', it is not a method, it is a constant so do not use parentheses at the end Sample run is shown below Enter radius of the cake: 4 Enter height of the cake: 2 Enter number of people: 5 Number of people is 5. Volume of a slice is 20.106192982974676 Enter number of people: 8 Number of people is 8. volume of a 311ce i3 12.566370614359172 Enter number of people: 1 Number of people is 1. Volume of a slice is 100.53096491487338 Enter number of people:0

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!