Write a java program using BlueJ to perform the following operations, i. Create an abstract class called FigureDesign wi
Posted: Fri May 20, 2022 10:07 am
Write a java program using BlueJ to perform the
following operations,
i. Create an abstract class called FigureDesign with
attribute radius and height, a final field PI whose value is
3.14.
ii. Add abstract methods volume()and print() to the
FigureDesign class.
iii. Create a class called Cone and Cylinder as
subclasses for the FigureDesign class. Add a field coneVolume and
cylinderVolume in Cone and Cylinder class respectively to store the
volume.
iv. Implement the method volume() in Cone and Cylinder
to find the volume of Cone and Cylinder.
(Hint : Formula for cone volume is
1/3*PI*radius*radius*height and cylinder is
PI*radius*radius*height )
i. Implement the method print() in Cone and Cylinder
class that displays radius, height, and volume.
Important notes before solving the
question:------------------------------------------------------------------------------
Please solve in the BlueJ program, not in the Java Online
program.
Also, I don't know how to use the BlueJ program, so
please tell me in detail how to open it, how to choose the type of
class and how the program runs.
Please solve and write the steps in detail with
screenshots.
If you will ignore my comment, you can leave the
question to another expert to solve.
following operations,
i. Create an abstract class called FigureDesign with
attribute radius and height, a final field PI whose value is
3.14.
ii. Add abstract methods volume()and print() to the
FigureDesign class.
iii. Create a class called Cone and Cylinder as
subclasses for the FigureDesign class. Add a field coneVolume and
cylinderVolume in Cone and Cylinder class respectively to store the
volume.
iv. Implement the method volume() in Cone and Cylinder
to find the volume of Cone and Cylinder.
(Hint : Formula for cone volume is
1/3*PI*radius*radius*height and cylinder is
PI*radius*radius*height )
i. Implement the method print() in Cone and Cylinder
class that displays radius, height, and volume.
Important notes before solving the
question:------------------------------------------------------------------------------
Please solve in the BlueJ program, not in the Java Online
program.
Also, I don't know how to use the BlueJ program, so
please tell me in detail how to open it, how to choose the type of
class and how the program runs.
Please solve and write the steps in detail with
screenshots.
If you will ignore my comment, you can leave the
question to another expert to solve.