subject

Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompts the user for the length, width, and
height of a rectangular room. Pass these three values to a method that does the following:
- Calculates the wall area of a room
- Passes the calculated wall area to another method that calculates and returns the
number of gallons of paint needed.
- Displays the number of gallons needed.
- Computes the price based on a paint price of $32 per gallon, assuming that the painter
can buy any fraction of a gallon of paint at the same price as a whole gallon.
- Returns the price to the main() method
The main() method displays the final price. For example, the cost to paint a 15-by-20-foot
room with 10-foot cielings is $64 dollars. Save as PaintClculator. java
**Note: I can prompt the user, but I can't get a return from my code.
import java. util. Scanner;
public class PaintCalculator {
public static void main(String [] args)
{
Scanner keyboard = new Scanner(System. in);
double wallArea;
double height;
double length;
double width;
double price;
double WallArea;
double paintQuantity;
//Prompts user for the dimensions of the room
System. out. print("Please enter the height of the room: ");
height = keyboard. nextDouble();
System. out. print("Please enter the length of the room: ");
length = keyboard. nextDouble();
System. out. print("Please enter the width of the room: ");
width = keyboard. nextDouble();
WallAreaMethod(height, length, width);
}
//Calulates the area of the wall in a room
public static double WallAreaMethod(double height, double length, double width)
{
double wallArea;
wallArea = length * height * width * height;
return wallArea;
}
//Computes the quanity of paint needed
public static double paintFormula(double wallAreaMethod, double price, double height, double length, double width)
{
double wallArea;
double paintQuantity;
paintQuantity = wallAreaMethod * 2 / 350;
System. out. println("For a room of height " + height + "feet, length " +
length + " feet, and width " + width + " feet you need to purchase "
+ paintQuantity + " gallons of paint.");
System. out. println("The price will be $" + price + ".");
price = paintQuantity * 32.0;
return price;
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:30
The source manager dialog box allows you to create sources, copy sources created and used in all the documents, modify sources an add bibliographic information to placeholders. true or false
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
You know the right answer?
Assume that a gallon of paint covers about 350 square feet of wall space. Create an application wit...
Questions
question
Mathematics, 22.08.2019 01:30
question
Mathematics, 22.08.2019 01:30
question
Mathematics, 22.08.2019 01:30
Questions on the website: 13722360