aspose file tools*
The moose likes Beginning Java and the fly likes third attempt at solving this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "third attempt at solving this" Watch "third attempt at solving this" New topic
Author

third attempt at solving this

andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
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]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

"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.


[My Blog]
All roads lead to JavaRanch
andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
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.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16


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.
andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
VICTORYYYYYYYYYYYYYYY

thanks a ton, that last bit really made a lot click
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: third attempt at solving this