Question
USING JAVA PROGRAMMING A circular prism, or cylinder, has a radius and height, see the diagram on the right. Write a Java program that prompts
USING JAVA PROGRAMMING
A circular prism, or cylinder, has a radius and height, see the diagram on the right. Write a Java program that prompts and reads from the user an integer value for the radius and likewise an integer value for the height. Then the program will calculate the total surface area and finally display the values for the radius, height, and the total surface area. We note that the total surface area for the circular prism on the right is 2r 2
+ 2rh.
If a student does the work merely within the main method, the work will not receive more than 2/3 of the total allocated marks. To achieve the full mark, students need to create a constructor that takes radius and height as the parameters to create a cylinder object, and create a method for the class to do the calculation of the surface area.
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