Computers and Technology

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;
}

}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:40, Serenitybella
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
image
Computers and Technology, 24.06.2019 13:00, sparkyjones02
Which best describes the condition under which the unicode output is the same as plain text ?
Answers: 1
image
Computers and Technology, 24.06.2019 23:00, lovelifekristy
Aselect query joins tables together by their a. table names. b. primary keys. c. first entries. d. field names.
Answers: 2
image
Computers and Technology, 24.06.2019 23:30, binkyv15
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
Do you know the correct answer?
Assume that a gallon of paint covers about 350 square feet of wall space. Create anapplication with...

Questions in other subjects:

Konu
English, 02.08.2019 23:30
Konu
English, 02.08.2019 23:30