File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

third attempt at solving this

 
andrew cassato
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.

 
andrew cassato
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
VICTORYYYYYYYYYYYYYYY

thanks a ton, that last bit really made a lot click
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic