Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25
  1. #21
    einstein1234 is offline Member
    Join Date
    Apr 2009
    Posts
    34
    Rep Power
    0

  2. #22
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default

    I cannot believe you can't follow the steps indicated in the template that was provided to you. For example:
    Java Code:
    // prompt user for the room's width
    // prompt user for the room's length
    In what you have already done, you have asked the user for the room's width.
    Java Code:
    System.out.println("Please enter the room's width:");
    width = input.nextInt();
    Now you have to do the same for the room's height...
    and the same for the number of doors...
    and the same for the number of small windows ...
    and the same for the number of large windows ...

    once you have done that, then you can start to do the first calculation.

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

  3. #23
    einstein1234 is offline Member
    Join Date
    Apr 2009
    Posts
    34
    Rep Power
    0

    Default

    wow, i did alot of readings and come up with the solution...YESSSS, i did it, thanks alot for all the help CJSLMAN..

    HERE IS THE CODE BELOW AND IT RUNS GREAT:
    /* This program calculates the number of gallons of paint needed to paint a room.
    Programmer:
    Date: April 9, 2009
    */

    import java.util.Scanner;

    public class PaintersHelper {
    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;
    public static void main(String[] args) {

    // declare all variables to be used
    int width, length, height, doors, lgwindows, smwindows;
    float gallons, subtraction;

    // 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();

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


    // subtractions is the sum of:
    subtraction = (doors * DOOR_SIZE) + (lgwindows * LARGE_WINDOW_SIZE) + (smwindows * SMALL_WINDOW_SIZE);
    // number of doors * door size
    // number of lgWindows * lgWindow size
    // number of smWindows * smWindow size
    // net square feet = gross square feet - subtractions
    netsquarefeet = grosssquarefeet - subtraction;
    // gallons = netSqFt / SQ_FT_PER_GALLON rounded to the nearest gallon

    gallons = netsquarefeet / SQ_FT_PER_GALLON;
    // display the answer.


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


    } // end of method main

    } // end of class PaintersHelper

  4. #24
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default Glad I could help

    You're welcome.
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

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

    Default

    ok , so i still have an assignment that has something to do with this assignment that i just completed, but how do i mark this post as complete or solved

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Errors in Program (Right Triangle)
    By SupaStudy in forum New To Java
    Replies: 3
    Last Post: 03-26-2009, 10:42 AM
  2. Replies: 3
    Last Post: 03-08-2009, 01:51 AM
  3. Replies: 5
    Last Post: 02-04-2009, 01:20 AM
  4. Help with Errors in Inventory Program
    By ljk8950 in forum AWT / Swing
    Replies: 3
    Last Post: 08-08-2008, 11:49 PM
  5. 3 errors and then terminate program
    By hezfast2 in forum New To Java
    Replies: 2
    Last Post: 05-20-2008, 01:57 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
  •