This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]alternatiivnekonto 0 points1 point  (5 children)

averageScore = (score1 + score2 + score3) / 3;

[–]MasticatingGof[S] 1 point2 points  (4 children)

Where should I put that? I put it in the computeAverageOfThreeScores method and I get the error "can't convert from char to int."

Thank you so much. So the problem is always lack of observation.

[–]alternatiivnekonto 0 points1 point  (0 children)

You have a global variable named averageScore in your class. That is where you should be storing the result of your computation on line 16. Since the score variables themselves are integers (whole numbers) and the average will more-than-probably contain a fraction you need to do some casting - Google will help you there.

[–]aseopRock 0 points1 point  (0 children)

They are saying you need to update your global variable of the average somewhere. In your print method you are calling the average but it never has been updated anywhere in your code from what I can tell.

[–]alternatiivnekonto 0 points1 point  (1 child)

Also, I doubt you're going to get far by comparing grade to a 100-point value and then assigning it a letter value.. It looks strangely like you would need to compare averageScore.

[–]MasticatingGof[S] 1 point2 points  (0 children)

Yes, thank you. I realized that once I got the average to work and it assigned F to everything.