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, 22.06.2019 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
All of the following are characteristics that must be contained in any knowledge representation scheme except
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
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, 28.01.2020 23:01
Questions on the website: 13722362