Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be

A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $18.00 per hour for labor. Write a program that allows the user to enter the number of rooms to be painted and the price of the paint per gallon. It should also ask for the square feet of wall space in each room. The program should have methods that return the following data:

The number of gallons of paint required

The hours of labor required

The cost of the paint

The labor charges

The total cost of the paint job

Other than the main() method, you must implement the 5 methods specified in the textbook:

All of them must RETURN a value (not a void method)

Some of them need parameter(s).

For a value which is returned in a previous method, DO NOT recalculate it if it is needed in another method. You can have a parameter to accept that value.

Note: If you do not create the 5 methods, your assignment receives 0!

Besides the methods indicated in the book, optionally, you can add additional methods (e.g., for input, output and so on).

Store given values (such as 8 hours of labor, 115 square feet, and so on) in constants. You do this in the global area (outside of all methods), and all methods can use them as needed.

Use either the Scanner or the JOptionPane to get input from the keyboard.

you do not have to enter the number of rooms, but rather just enter the total square feet to be painted.

Output for the floating points should be in the format of #0.00. You can use DecimalFormat class to format outputs (Instruction and examples of using this format are in Unit 1 lecture notes, slides #44-48, and in Payroll.java file)

You can use data in the following screen shots to test your program:

Example 1 (Inputs are total square feet and price of paint): The first 2 lines are input, and the last three lines are the output.

How many total square feet need to be painted? 500

What is the cost of the paint per gallon? 42.79

The cost for paint is $213.95

The cost for labor is $626.09

The total cost for the job is $840.04

Example 2 (Inputs are number of rooms, total square feet for each room, and price of paint): The first 4 lines are input, and the last three lines are the output.

How many rooms need to be painted? 2

How many square feet is room 1? 250

How many square feet is room 2? 238

What is the cost of the paint per gallon? 57.18

The cost for paint is $285.90

The cost for labor is $611.06

The total cost for the job is $896.96

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions