jamie keene

Greenhorn
+ Follow
since Feb 15, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jamie keene

thanks!
13 years ago
thank you, that helped, but now i am stuck on doing a margin of error
this is what i have


but i know that i cant do (tract1 - tract2) but i dont think i can do margin of error with tract1.compareTo(tract2)
13 years ago
so i got it to work, i had miss named something in one of the files, but now it is returning an area of 0.0





return looks like this

----jGRASP exec: java LandTractDemo

Enter the length and width of Tract 1: 10 20
Enter the length and width of Tract 2: 15 25

TRACT 1: length is 10.0, width is 20.0, area is 0.0
TRACT 2: length is 15.0, width is 25.0, area is 0.0

The tracts are NOT the same size

----jGRASP: operation complete.

13 years ago
I think i have the codes right, and the main method was provided, yet i am getting errors in both methods
this compiles with no error

this is the provided main method, which i can not compile

error is :

----jGRASP exec: javac -g LandTractDemo.java
LandTractDemo.java:20: cannot find symbol
symbol : class LandTract
location: class LandTractDemo
LandTract tract1 = new LandTract(length, width);
^
LandTractDemo.java:20: cannot find symbol
symbol : class LandTract
location: class LandTractDemo
LandTract tract1 = new LandTract(length, width);
^
LandTractDemo.java:28: cannot find symbol
symbol : class LandTract
location: class LandTractDemo
LandTract tract2 = new LandTract(length, width);
^
LandTractDemo.java:28: cannot find symbol
symbol : class LandTract
location: class LandTractDemo
LandTract tract2 = new LandTract(length, width);
^
4 errors

----jGRASP wedge: exit code for process is 1.

13 years ago

i know this isn't compiling right, but i don't know how to fix it so it runs right
i need to add a way to make the string "*" show up for each $1000
13 years ago
i'm not sure how to code the for loop, i already have on in there, but how do i alter it so that every $1000 = * ?
because my current for loop is what makes the salary double

13 years ago
a while loop?
13 years ago
i thought i could try declaring a String variable named stars that represented *
and then take the salary/1000 and have that = the number of stars but i couldn't figure out the code for that
13 years ago


this code runs correcty as is, but how do i change it to create instead of a table with a salary a table with ***
for example
current out put would be :


----jGRASP exec: java salary
How many years will you work? 4
Year Salary Earned
--------------------------
1 $1,000.00
2 $2,000.00
3 $4,000.00
4 $8,000.00

Total pay: $15,000.00
Average salary: $3,750.00

----jGRASP: operation complete.



desired output would be


----jGRASP exec: java salary
How many years will you work? 4
Year Salary Earned
--------------------------
1 *
2 **
3 ****
4 ********

Total pay: $15,000.00
Average salary: $3,750.00

----jGRASP: operation complete.

13 years ago

but i get the error of an odd repeat.. and how can i count the wins/loses to total at the end?

this is what the error looks like

----jGRASP exec: java Game
Enter your choice (Same or Different):
same
Computer flipped Tails and Heads
YOU LOSE
Would you like to try again (yes or no):
yes
Enter your choice (Same or Different):
Computer flipped Tails and Tails
YOU LOSE
Enter your choice (Same or Different):

13 years ago

is there a way to get the computer play another round without having to rerun the program?
13 years ago

does that work? or will that be an error?
I don't know how to get the user input to read since it is a string, so by doing coice = same does that mean that if the user inputs same it will work?
13 years ago


so how do i make the coin1 == coin2 same and coin1 != coin2 different match the input from the user?
13 years ago
i don't know how to use toString though
13 years ago
i'm completely lost though, its like i'm treading water, can anyone give me an example or anything?
13 years ago