Sup fellas!
I'm having some problems with my code.. Can you please help me out! Thanks
Here is the code:
import java.util.Scanner; public class Paint { public static void main(String[] args) { final int COVERAGE = 350; //paint covers 350 sq ft/gal //declare integers length, width, and height; String length; String width; String height; //declare double totalSqFt; Double totalSqFt; //declare double paintNeeded; Double paintNeeded; //declare and initialize Scanner object //Prompt for and read in the length of the room Scanner len; System.out.println("Enter the length of the room: "); length = len.next(); //Prompt for and read in the width of the room Scanner wid; System.out.println("Enter the width of the room: "); width = wid.next(); //Prompt for and read in the height of the room Scanner hei; System.out.println("Enter the hight of the room: "); height = hei.next(); //Compute the total square feet to be painted--think //about the dimensions of each wall totalSqFt = (len * hei) + (wid * hei); //Compute the amount of paint needed paintNeeded = totalSqFt - 350; //Print the length, width, and height of the room and the //number of gallons of paint needed. System.out.println("The length is "+len); System.out.println("The width is "+wid); System.out.println("The height is "+hei); System.out.println("The number of gallons of paint needed is: "+paintNeeded); } }
The comments in the code are telling you what are you supposed to do..