Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Noob Problem.

  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Thanked 0 Times in 0 Posts

    Noob Problem.

    ok guys im really new at java and just want some help in making this work

    I basically need to Implement this pseudocode in java. This is basic program which just finds the total area of which i need to cut on the lawn. i need to calculate the area of the land and then subtract of from the area of the house. The problem is that i can't seem to figure out wat code i need to type. below is my identifer list.

    blockArea - Integer - total area of house block.
    blockLength - Integer - length of the block.
    blockWidth - Integer - width of the block.
    houseArea - Integer - the area which the house occupies
    houseLength - Integer - length of the house.
    houseWidth - Integer - width of the house.
    mowingArea - Integer - the area surrounding the house
    mowingTime - Real - how long it takes to mowe the calculated mowingArea, consider in 1 minute they can mow 2 square meters.

    I have constructed a basic algorithm as well..


    Prompt for blockLength, blockWidth
    Get blockLength, blockWidth
    blockArea = blockLength * blockWidth

    Prompt for houseLength, houseWidth
    Get houseLength, houseWidth
    houseArea = houseLength * houseWidth

    mowingArea = blockArea - houseArea
    mowingTime = mowingArea / 2
    Display mowingTime

    If anyone here could help me out please in producing a code or atleast guiding me to a site which explains on how to produce calculations and promots then tat would be great. I also need to produce OO implementation driver but i may be able to do that later. thanks

  2. #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,703 Times in 2,679 Posts
    Sounds like a homework assignment to me.
    And Java is a completely different language to JavaScript, in spite of the confusingly similar names.

  3. #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    Read your book. Look into declaring and initializing variables. You are using ints so it won't be hard. Prompting the user to enter input can be done in various ways. I find JOptionPane to be easiest but you probably haven't learned that yet. Look into System.in or the Scanner class to get user input if you want it from the DOS prompt. What book are you using anyways?


Posting Permissions

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