Question
Create a program to compute the wall area of a room and calculate the paint andprice needed to decorate it. We assume that a gallon
Create a program to compute the wall area of a room and calculate the paint andprice needed to decorate it. We assume that a gallon of paint covers about 350 squarefeet of wall space. The program will use main() and 2 additional methods.Main() will use a JOptionPane.showInputDialog to prompt users for the length,width, and height of a rectangular room.Main() method will pass these THREE values to a method that does the following:- calculates the wall area for a room (wall area for a room = area of all four walls...)- passes calculated area to another method that calculates and returns # gallons paint needed- displays the number of gallons needed- computes price based on $32/gallon (assumes painter can buy any fraction of a gallon atsame price as whole gallon)- returns the price to the main() methodThe main() method will then use a JOptionPane.showMessageDialog box todisplay the final price.For example, the cost to paint a 15-by 20-foot room with 10-foot ceilings is $64.
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