Question: Hey Chegg, I have this problem in JAVA: Paint Calculator This assignment is based off Programming Challenge 3 at the end of chapter 8. The

Hey Chegg, I have this problem in JAVA:

Paint Calculator

This assignment is based off Programming Challenge 3 at the end of chapter 8. The programming challenge, titled Carpet Calculator, asks you to design and implement an application that calculates the price of carpeting for rectangular rooms. It does this with two classes; RoomCarpet which calculates the cost based on the size of the room (i.e., the square feet of the room). And RoomDimension which encapsulates the dimensions of the room.

For this assignment, you will implement a class named RoomPaint to be used for calculating the number of gallons of paint required to paint the walls and ceiling of a room. Note that the size of the room includes the surface area of the four walls and the ceiling. Assume that a gallon of paint will cover 400 square feet with a single coat. Dont consider windows and doors in your calculation.

The first step in developing the application is to create a class named RoomDimension, similar to the class described by the UML in Figure 8.21 (UML diagram for Programming Challenge 3).

For this assignment, RoomDimension should calculate the square feet of the four walls and the ceiling. Your implementation RoomDimension should at least have these members:

private double length;

private double width;

private double height;

public RoomDimension (double length, double width, double height) {}

public double getArea () {}

public String toString () {}

The RoomPaint class should have these members:

private RoomDimension area;

public RoomPaint (double length, double width, double height) {}

public RoomPaint (RoomPaint otherRoom) {}

public copy (RoomPaint otherRoom) {}

public int getGallons () {}

public String toString () {}

The RoomPaint getGallons method should return whole gallons of paint. Once you have written these two classes, write a third class that instantiates the RoomPaint class and demonstrates that RoomPaint and RoomDimension meet the requirements of the assignment.

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!