Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program Specifications Write a program to calculate the cost to paint a wall. Amount of required paint is based on the wall area. Total cost
Program Specifications Write a program to calculate the cost to paint a wall. Amount of required paint is based on the wall area. Total cost includes paint and sales tax.
Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.
Step pts Read from input wall height, wall width, and cost of one paint can doubles Calculate and output the wall's area to one decimal place using System. out.printf Wall area: f sq ft
area ; Submit for grading to confirm test passes. Ex: If the input is:
the output is:
Wall area: ft
Step pts Calculate and output the amount of paint needed to three decimal places. One gallon of paint covers square feet.
Submit for grading to confirm tests pass.
Ex: If the input is:
the output is:
Wall area:
Paint needed: gallons
Step pts Calculate and output the number of gallon cans needed to paint the wall. Extra paint may be left over. Hint: Use Math.ceil
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started