Forums Register Login

third attempt at solving this

+Pie Number of slices to send: Send
hey, me again. this wont work. I want to have the final score show up once i press the calculate scores button but am losing the data because I don't know what code is missing to save the score, nor do i know where to put it. I understand why the result is 0.0, i just really really really dont know how to make it work.

this assignment is already late to the point that I won't get credit so dont worry about just telling me the answer at this point i just want it working for a reference to later assignments / exam.

any sort of help is appreciated.

its in 3 classes and i will give you all the code in case you want to try to run it, the error is on line 97 of GUI class: "cannot find symbol - method parseInt(double); maybe you meant: parseInt(String) or parseInt(String, int)"

JUDGING CLASS

GUI CLASS

TEST

[/code]
1
+Pie Number of slices to send: Send
 

"cannot find symbol - method parseInt(double); maybe you meant: parseInt(String) or parseInt(String, int)"


Andrew, I'm quite disappointed with your progression so far. You're still getting the same kind of error again and again. You don't seem to be willing to study how to read a method signature and how to call a method based on that signature. You'll still be struggling in the next assignment, even if you get the answer of this one.

I'd like to advice you to read something abuot methods. For example, Thinking In Java. Read the part called "Methods, arguments, and return values". It's very important.

+Pie Number of slices to send: Send
thanks i read over that and have a better understanding. i thought my problem now is that the data is not getting stored, when i print the result i just get 0.0 even tho the debugger shows the array score to be full of data. once its passed thru calculate scores im not really sure what happens but by the time i get to line 96: the debugger shows the value of result at 0.0. the name of the variable in calculateScores that holds the final number i want to display as finalScore, do i use this variable in the GUI class? to me that seems like its the bridge i cant really build - especially since calculateScore() returns void.
1
+Pie Number of slices to send: Send

This method is not right. Why are you setting the finalScore here ? The finalScore is set in calculateScore. You should just return the finalScore here.

Actually, by looking at your assignment again, there is no "finalScore" variable at all. Remove it. Remove it completely. Then, in calculateScore, set the "result" variable. This variable should hold the final score. Then, in getResult, you should just return the "result" variable.
+Pie Number of slices to send: Send
VICTORYYYYYYYYYYYYYYY

thanks a ton, that last bit really made a lot click
+Pie Number of slices to send: Send
Well done, and it's good when you can see the penny drop.

But be careful with thread titles, please; somebody coming new to this forum won't know what the first and second attempts were.
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1346 times.
Similar Threads
more problems calling methods
i cant figure out how to use these methods
Converting threadgroup to executorservice
losing data
cant find methods
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:50:07.