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 no-args constructor initializes the radius and height to 1.
The getSurfaceArea method returns the surface area as 2***r**h+2**p**r2,
where r and h represent the radius and height, respectively.
The getVolume method returns the volume as h****r2.
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 12.566370614359172
The volume of the cylinder is 3.141592653589793
Use the setter methods to assign the value 5 to the radius and 10 to the height.
Print the following statements to the console using the getter methods:
Programming Fundamentals I - Final Exam Program

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 Programming Questions!