Results 1 to 2 of 2
  1. #1
    Gfunk is offline Member
    Join Date
    Mar 2010
    Posts
    4
    Rep Power
    0

    Red face 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

    }

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    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.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. [newbie]
    By jon80 in forum New To Java
    Replies: 10
    Last Post: 07-07-2009, 01:10 PM
  2. Another newbie
    By PhHein in forum Introductions
    Replies: 0
    Last Post: 04-22-2009, 02:26 PM
  3. :) newbie...........
    By Somitesh Chakraborty in forum Introductions
    Replies: 1
    Last Post: 08-19-2008, 10:00 AM
  4. newbie newbie newbie
    By krislogy in forum New To Java
    Replies: 9
    Last Post: 08-15-2008, 01:28 AM
  5. Newbie
    By CSnoob87 in forum Introductions
    Replies: 2
    Last Post: 02-18-2008, 09:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •