Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a class diagram which includes both service and application/client classes. Name your service class PaintEstimater. This class should include: O Data members Private

image text in transcribedimage text in transcribedimage text in transcribed

1. Create a class diagram which includes both service and application/client classes. Name your service class PaintEstimater. This class should include: O Data 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. o Public 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 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 The following screen shot shows sample inputs and outputs. You can use to test your program: Roon 1 : Please enter the square footage of the wall: 500 Please enter the price per gallon of the paint: 16.7 The cost for the paint: $72.61 The cost for the labor: $626.09 The total cost : $698.70 Roon 2: Please enter the square footage of the wall: 493 Please enter the price per gallon of the paint: 15.5 The cost for the paint: $66.45 The cost for the labor: $617.32 The total cost: $683.77 The total cost of the paint job: 1382.47

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions