Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Noob Problem.
04-28-2006, 06:19 AM #1
- Join Date
- Apr 2006
- Thanked 0 Times in 0 Posts
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.
IDENTIFIER - TYPE - DESCRIPTION
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
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
04-28-2006, 07:32 AM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,673 Times in 2,649 Posts
Sounds like a homework assignment to me.
04-28-2006, 07:45 AM #3
- 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?