Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    Tshegofatsom is offline Member
    Join Date
    Apr 2009
    Location
    Pretoria, Gauteng, South Africa
    Posts
    43
    Rep Power
    0

    Default

    Wots wrong? How can we help you?
    Tshegofatso Manakana
    a.k.a Untouchable ™

  2. #22
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

    Default

    read post 15 in detail...
    Fubarable gave you the answer...

  3. #23
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by einstein1234 View Post
    help meeeee
    I've no idea how. You have not told us what changes you have made to your program, what you understand about previous advice, what you don't understand, where you're stuck....

    Best of luck.

  4. #24
    einstein1234 is offline Member
    Join Date
    Apr 2009
    Posts
    34
    Rep Power
    0

    Default

    ok hold on, let me look at the code and try to ask a specific question. if i can.

  5. #25
    einstein1234 is offline Member
    Join Date
    Apr 2009
    Posts
    34
    Rep Power
    0

    Default

    finnallly i got it guys...thanx for da help, but i did most of the reading so,,thanxxx...50/50

    thanxs chris and fubarable, mainly chris....

    heres da code../* This program calculates the number of gallons of paint
    needed to paint a room.

    Programmer:me
    Date:
    */

    import java.util.Scanner;

    public class PaintersHelpersSplit {
    static float DOOR_SIZE = 15.0f;
    static float SMALL_WINDOW_SIZE =2.0f;
    static float LARGE_WINDOW_SIZE = 5.0f;
    static float SQ_FT_PER_GALLON = 375.0f;
    static float netsquarefeet;
    static float grosssquarefeet;
    // declare all variables to be used

    public static void main(String[] args) {


    int height,length,width, doors, smwindows, lgwindows;
    int gallons;
    // give welcome and instructions to user
    System.out.println("Welcome to the painters Helper");


    Scanner input = new Scanner (System.in);

    // prompt user for the room's width
    System.out.println("Please enter the room's width:");
    width = input.nextInt();

    // prompt user for the room's length
    System.out.println("Please enter the room's length:");
    length = input.nextInt();

    // prompt user for the room's height
    System.out.println("Please enter the room's height:");
    height = input.nextInt();

    // prompt user for the number of doors
    System.out.println("Please enter the number of doors:");
    doors = input.nextInt();

    // prompt user for the number of small windows
    System.out.println("Please enter the the number of small windows:");
    smwindows = input.nextInt();

    // prompt user for the number of large windows
    System.out.println("Please enter the number of large windows:");
    lgwindows = input.nextInt();

    gallons = computeGallons(length, height, doors, width, lgwindows, smwindows);


    System.out.println("You will need about " + gallons + "gallons of paint for your room.");


    } // end of method main

    static int computeGallons(int length, int height, int doors, int width, int lgWindows, int smWindows) {

    float grosssquarefeet, subtraction,netsquarefeet;

    int gallons;

    // gross square feet = height * 2 * (length + width)
    grosssquarefeet = height * 2 * ( length + width);


    // net square feet = gross square feet - subtractions
    subtraction = (doors * DOOR_SIZE) + (lgWindows * LARGE_WINDOW_SIZE) + (smWindows * SMALL_WINDOW_SIZE);


    netsquarefeet = grosssquarefeet - subtraction;

    // gallons = netSqFt / SQ_FT_PER_GALLON rounded to the nearest gallon
    gallons = Math.round(netsquarefeet / SQ_FT_PER_GALLON);
    return gallons;

    } // end of computegGallons

    } // end of class PaintersHelper

  6. #26
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default

    Hey, that's great !!! Go Team Go....

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  7. #27
    einstein1234 is offline Member
    Join Date
    Apr 2009
    Posts
    34
    Rep Power
    0

Page 2 of 2 FirstFirst 12

Similar Threads

  1. I couldn’t figure out how to do this please help!
    By afrttoh in forum New To Java
    Replies: 5
    Last Post: 11-19-2008, 09:21 PM
  2. Replies: 2
    Last Post: 11-08-2008, 05:58 AM
  3. Replies: 2
    Last Post: 07-11-2008, 10:41 AM
  4. Seems so simple yet I can't figure it out!
    By adamhaviland in forum New To Java
    Replies: 1
    Last Post: 11-03-2007, 07:26 PM
  5. I can't figure this out
    By silvia in forum New To Java
    Replies: 3
    Last Post: 07-20-2007, 05:38 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
  •