Question: Create class diagram which includes both service and application/client classes. Name your service class PaintEstimater . This class should include: oData members Private variables for

Create class diagram which includes both service and application/client classes.

Name your service class PaintEstimater. This class should include:

oData members

Private variables for data: to keep the class simple, you only need total square feet and price for paint. (Thus, there is no need to provide width, length, height, and numbers of windows and doors to calculate total square feet. If you would like to keep these data, then you need to have more parameters for a constructor, and a set of mutator and accessor for each)

Public or private constants for given values (do not need constants for sizes of window and door)

Note: In the data member section, only need to declare variables and constants for DATA. DO NOT declare a private variable to store a calculated value, which can be returned by a method. Whenever the value is needed, just call that method.

oPublic member methods:

A default constructor

A constructor with parameters to initialize all data members (non-constants)

Other constructors (optional)

A set mutator and accessor for EACH of data members

Five methods, each returns a value

The number of gallons of paint need (round up this value to the nearest whole number)

The hours of labor required

The cost of the paint

The labor charges

The total cost of the paint job

Again, there is no need to have a private data member to store this type of values.

Other methods (e.g., for output) (optional)

Add the application/client class to the diagram and show relationship to the service class.

2.Implement the design in Java code

Your program should reflect the design the class diagram.

If you change data member/field name or data type, or add/remove a variable in Java code, make change in the diagram.

If you change method header (return type, name, and parameter) in Java code, or add/remove a method in Java code, make change in the diagram.

Service class and application class should be written in separate .java files.

Actual user inputs should be conducted in the application class (not in the service class), and then pass as arguments to the constructors or mutators of the service class.

All methods in the service class are instance method, meaning there is not this keyword, static, in the method header.

In the application class,

Instantiate at least TWO objects of the PaintEstimater class by using two different constructors, each object represents a room.

Test all mutators and data processing methods defined in the service class.

Format outputs for numeric data (if you have an output method in the service class, format in that method; if not, format them in the main() in the application class).

3.Test the program by displaying the output results

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!