subject

Assume that a gallon of paint covers about 350 square feet of wall space. Create anapplication with a main() method that prompts the user for the length, width, andheight of a rectangular room. Pass these three values to a method that does the following:-a. Calculates the wall area of a roomb. Passes the calculated wall area to another method that calculates and returns thenumber of gallons of paint needed. c. Displays the number of gallons needed. d. Computes the price based on a paint price of $32 per gallon, assuming that the paintercan buy any fraction of a gallon of paint at the same price as a whole gallon. e. 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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
What “old fashioned” features of checking accounts is p2p replacing
Answers: 3
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
Assume that a gallon of paint covers about 350 square feet of wall space. Create anapplication with...
Questions
question
Mathematics, 03.07.2019 15:30
question
Mathematics, 03.07.2019 15:30
question
Mathematics, 03.07.2019 15:30