Question: Programming Fundamentals I - Final Exam Program Your program should consist of two files: Cylinder.java and Main.java. Once you are done, submit these files on
Programming Fundamentals I Final Exam Program
Your program should consist of two files: Cylinder.java and Main.java. Once you are
done, submit these files on BlackBoard under the Final Exam section.
The methods of the Cylinder class should have the following behaviors:
The noargs constructor initializes the radius and height to
The getSurfaceArea method returns the surface area as
where and represent the radius and height, respectively.
The getVolume method returns the volume as
The setRadius method assigns the value of newRadius to the radius field.
The setHeight method assigns the value of newHeight to the height field.
The Main class, in Main.java, will hold the main method for this program. The main
method should do the following:
Construct an object of the Cylinder class.
Print the following statements to the console using the getter methods:
The surface area of the cylinder is
The volume of the cylinder is
Use the setter methods to assign the value to the radius and to the height.
Print the following statements to the console using the getter methods:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
