* CENGAGE MINDTAP Q Search this course Programming Exercise 3-8 Instructions PaintCalculator.java >- Terminal 1 import java.util.Scanner; 2 public class PaintCalculator { public static void main (String args[]) { // Write your code here sandbox $ || Assume that a gallon of paint covers about 350 square feet of wall 3 space. Create an application with a main() method that prompts 4 the user for the length, width, and height of a rectangular room. </> Pass these three values to a method that does the following: public static double computeArea (double length, double width, double height) { // Write your code here } public static double computeGallons (double area) { // Write your code here 8 • Calculates the wall area for a room 9 • Passes the calculated wall area to another method that 10 11 calculates and returns the number of gallons of paint needed } 13 } 12 • 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: You will need 2.0 gallons The price to paint the room is $64.0
* CENGAGE MINDTAP Q Search this course Programming Exercise 3-8 Instructions PaintCalculator.java >- Terminal 1 import java.util.Scanner; 2 public class PaintCalculator { public static void main (String args[]) { // Write your code here sandbox $ || Assume that a gallon of paint covers about 350 square feet of wall 3 space. Create an application with a main() method that prompts 4 the user for the length, width, and height of a rectangular room. </> Pass these three values to a method that does the following: public static double computeArea (double length, double width, double height) { // Write your code here } public static double computeGallons (double area) { // Write your code here 8 • Calculates the wall area for a room 9 • Passes the calculated wall area to another method that 10 11 calculates and returns the number of gallons of paint needed } 13 } 12 • 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: You will need 2.0 gallons The price to paint the room is $64.0
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 2GZ
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT