# newbie Needs urgent help

• 03-16-2010, 09:12 AM
Gfunk
newbie Needs urgent help
Ok so im a complete newbie and i need help with a project im working on for class. Its 3am here and i hav to hand it in by 8am. Im freakin tired and nothings working for me. I would HUGELY appreciate it if anyone could have a look at my code and step me in the right direction

Heres the instructions-

Write a program that calculates the amount of paint needed to paint a room.

The program should start by asking the user for the length, width, and height of the room, and the number of doors. It should then compute the area of wall that needs to be painted, subtract the area of the doors, and then compute the amount of paint. Finally, it should print out the total amount of paint needed.

* all the doors have a standard size of 80cm by 2.1m,
* one litre of paint covers 15 square metres.

And heres my code so far

import java.util.*;
import comp100.*;
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.BorderLayout;
import java.awt.Color;

public class PaintCalculator{

public void userinput (String args [])
{

double l = Double.parseDouble("Not sure what to put here??");
double w = Double.parseDouble("Not sure what to put here??");
double h = Double.parseDouble("Not sure what to put here??");
double d = Double.parseDouble("80 * 2.1");
double wallarea = Double.parseDouble("l" + "w" + "h"); Is this right?

JOptionPane.showInputDialog("Insert a " + l + " ");

JOptionPane.showInputDialog("Insert a " + w + " ");

JOptionPane.showInputDialog("Insert a " + h + " ");

JOptionPane.showInputDialog("Insert number of " + d + " ");

System.out.println();

}

public void calculatePaint(){
// code is going to go here

}
• 03-16-2010, 09:57 AM
PhHein
There's no way you get that done in 5 hours. Go to bed and start your next exercise a bit earlier.

A few pointers won't help you at all, and nobody will finish your assignment for you.