(Solved):Painting a wall Enter wall height (feet): 12 Enter wall width (feet): 15 Wall area: 180 square feet Paint needed: 0.514286 gallons Cans needed: 1 can(s) import java.util.Scanner; import java… View Answer…

 

Question

Painting a wall

Enter wall height (feet): 12

Enter wall width (feet): 15

Wall area: 180 square feet

Paint needed: 0.514286 gallons

Cans needed: 1 can(s)

import java.util.Scanner;

import java.lang.Math; // Note: Needed for math functions in part (3)

public class PaintEstimator {

public static void main(String args) {

Scanner scnr = new Scanner(System.in);

double wallHeight = 0.0;

double wallWidth = 0.0;

double wallArea = 0.0;

System.out.println(“Enter wall height (feet): “);

wallHeight = scnr.nextDouble();

System.out.println(“Enter wall width (feet): “);

wallWidth = scnr.nextDouble();

wallArea = wallWidth * wallHeight;

 

EXPERT ANSWER

import 

Scroll to top