We\'ve been learning about methods in java (using netbeans) in class and I\'m still a bit confused about using methods. One homework question basically asks to design a grade ca
A couple of things spring to mind:
You execute scoreCalc()
twice. Probably you want to execute it once and save the result in a double
variable like: double score = scoreCalc()
.
Speaking of scoreCalc()
: Your definition takes 4 parameters that your don't have as input for that method. You should remove those from your method definition, and instead add score1
, maxMark
, weighting
and finalScore
variable declarations in the method-body.
In your main function, you declare and instantiate a Scanner
object you don't use.
Be careful with arithmetic that mixes int
and double
.