Question: JAVA Develop a Java project of shapes and write a program that computes the amount of paint needed to paint different objects. The project will

JAVA

JAVA Develop a Java project of shapes and write a program that

Develop a Java project of shapes and write a program that computes the amount of paint needed to paint different objects. The project will consist of a super class Shape with three derived classes - Circle, Sphere, and Cylinder. The only attribute a shape will have is a name. You are asked to complete the following. 1. Write a class Shape with the following properties: An instance variable shapeName of type String A toString method that returns the name of the shape 2. Write a Paint class which has a "coverage" variable and a method "amountOfPaint" to compute the amount of paint needed to paint a shape. The amount of paint needed is the area of the shape divided by the coverage for the paint. 3. Write three sub classes with the following properties: Circle class is a descendant of Shape class. A Circle has a radius variable and an area method (surface area) is given by the formula Pi*radius2. Define similar classes for a Sphere and a cylinder. Both classes are descendants of the Shape class. A Sphere has a radius variable and the area method is defined by the formula 4*Pl*radius^2. A cylinder is defined by a radius and height and its area (surface area) is Pl*radius^2*height. Define the toString method in a way similar to that for the Sphere class. Each class has an argument constructor to set the data member/s. Each class has an object member of the type Paint. int he constructor of each sub class, the Paint "coverage" value need to be determined. 4. create PaintThings.java file which contains a main method that computes the amount of paint needed to paint various shapes. Instantiate the three shape objects: trampoline to be a Circle of radius 20 feet, bigBall to be a sphere of radius 8 feet, and tank to be a cylinder of radius 10 feet and height 30 feet. All of the objects will use the same paint type where the coverage equal 400 square feet". . find out which Object needs more paint out of all the 3 objects and which one need less

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!