Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    moostico246 Guest

  2. #22
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Quote Originally Posted by moostico246 View Post
    its an elective ,im a biology MAJOR,,do u understandddd
    I prefer to think you're just another boring troll.

    The alternative - that you might be a tertiary student - is just too depressing.

  3. #23
    moostico246 Guest

    Default

    i didnt understand a word u said , juss get out ur no help here, someone help me with dis: i got dis so far

    The unit for all inputs is feet. The result of the calculation will be in square feet.

    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;

    public static void main(String[] args)
    {
    int gallons = 0;
    int roomWidth = 0;
    Scanner input = new Scanner(System.in);
    System.out.println("Hello, and welcome to the Painter's Helper Program");
    System.out.print("Please enter the room's width: ");

    String widthStr = input.nextLine();
    try
    {
    widthStr += " feet";
    roomWidth = Integer.parseInt(widthStr);
    }
    catch (NumberFormatException e)
    {
    ShowErrorMessage();
    }
    // prompt user for the room's length

    // prompt user for the room's height

    // prompt user for the number of doors

    // prompt user for the number of small windows

    // prompt user for the number of large windows

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

    // subtractions is the sum of:
    // number of doors * door size
    // number of lgWindows * lgWindow size
    // number of smWindows * smWindow size

    // net square feet = gross square feet - subtractions

    // gallons = netSqFt / SQ_FT_PER_GALLON rounded to the nearest gallon

    // display the answer.
    System.out.println("\nYou will need about " + gallons
    + " gallons of paint.");
    } // end of method main


    {
    String[] strArray = new String(PaintHelperErrorArray).split(" ");
    int delay = 400;
    for (;;)
    {
    for (String string : strArray)
    {
    System.out.print(string + " ");
    try
    {
    Thread.sleep(delay);
    }catch (InterruptedException e){}
    }
    System.out.println();
    delay *= 7;
    delay /= 10;
    }
    }


    }

Page 2 of 2 FirstFirst 12

Similar Threads

  1. I need help on a practice code for java
    By Sageinquisitor in forum New To Java
    Replies: 12
    Last Post: 07-13-2010, 05:00 PM
  2. [SOLVED] Is this good programming practice?
    By porchrat in forum New To Java
    Replies: 9
    Last Post: 04-08-2009, 01:54 PM
  3. [SOLVED] Best practice for creating test classes
    By mwildam in forum New To Java
    Replies: 3
    Last Post: 08-27-2008, 05:59 PM
  4. Best practice of IF loop with NOT
    By sathishranganathan in forum Advanced Java
    Replies: 13
    Last Post: 05-29-2008, 01:11 PM
  5. Web Services - IBM Expands SOA Management Practice
    By Felissa in forum Web Frameworks
    Replies: 0
    Last Post: 06-25-2007, 05:08 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
  •