I am getting an error when I try to pass an array (score) to a method in another class. i am not sure i have them set up right - I am trying to have the contestant's score calculated and displayed when i press the calculate scores button but get the error
getScores() in Judging cannot be applied to (double) here is all the code. error is on line 78 of the GUI class
You are calling a method called getScores, have one parameter of type double. There is no such method in the Judging class. Same for getResult. What are you trying to do. Your methods have no parameter, but they return something. So you are expected to call them like :
But still, I don't understand why you are calling these methods.
(it would help next time to post the full stack trace of your compilation error)
I'm actually not even sure what the setScores and getScores methods do, I just have the outline of the program with those methods:
| Judging |
| - int n //number of judges |
| - double  scores //scores of n judges |
| - double result;//the score from judges |
| + Judging(int) |
| + setScores(double ) :void |
| + inputScores() :void |
| + calculateScore() : void |
| + getScores(): double  |
| + getResult(): double |
using the UML i know these methods are supposed to be used i just dont really know how... To me it seems like I would just have to send the array of scores to calculateScores and have it return the finalScore but then I dont know what the other stuff is for.
That UML tells you the Judging class has three private (= "-") fields, n, scores and result; it also tells you what types they are.
It tells you the class has a public (= "+") constructor taking an int as parameter, a setScores method taking double and returning void, an inputScore() method with no parameters and void return type and three other methods which I am sure you can now work out from the diagram.
There ought to be a javadoc document made from that class; it will be in html format and you open it with a web browser. That should tell you what the constructor and 4 methods do.
Have you no shame? Have you no decency? Have you no tiny ad?