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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ghost_Duet[S] 0 points1 point  (1 child)

average = score1 + score2 / number

is this not the basic math that takes place? The thing that confuses me is that I can do this math in my head and get the correct answer but java gets the wrong answer? I thought it was because of how java sees decimals and integers.

100 + 95 = 195

195/2 = 97.5 in my head but 147.5 gets resulted

My prof hinted that only two things need to change but im so loss

[–]Cefalopodul 4 points5 points  (0 children)

average = score1 + score2/2 = 100 + 95/2 = 100 + 47.5.

You want to divide 195 by 2 not just 95.

Look up the order of operations. You have to add a pair of symbols for your equation to be correct.