Question: Write a program to calculate the volume and surface area of a cylinder. Allow the user to input the data initially, validate user's input only

 Write a program to calculate the volume and surface area of

Write a program to calculate the volume and surface area of a cylinder. Allow the user to input the data initially, validate user's input only when all input data are positive the program will calculate. If the data is not valid, all user to input again, maximum three times. Allow the user to change the radius and height of a cylinder. In the TestCylinder class, you need to create objects using different constructors at least once. for instance Cyelinder cyd new CyclinderO: sure the user can input the radius and For each object, make height with valid values and display the final volume and surface area. You need two constructors for the Cylinder class: Cylinder) and Cylinder(double r, double h) You need to define following method in the Cylinder class: /lcalculate the volume of a cylinder with radius of I, and height of h public void findVolume(double I, double h) lcalculate the volume of a cylinder public void findVolume0 l all accessor methods public double findRadius) public double findHeighto Il all mutator methods to change the radius and the height of the cylinder. The input data is from user. public void setLength double I) public void setHeith(double h) In the TestCylinder class: Create two Cylinder object using different constructor You need to display the volume of two Cylinder objects in GUI A class diagram in UML notation is shown in following: Cvlinder radius: double height: double TestCvlinder -PI: double main( Stringl): Cylindero Cylinder(double, getRadius0: double t getHeight0: double + setRadius(double): void setHeight(double): void + findVolume): double + findVolume(double le): double + findSurArea0: double

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!