Skip to content

Commit d620d3a

Browse files
committed
Fixed grade math
1 parent ff13d8a commit d620d3a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

TimedMathGame.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def passed
2424
if timer.passed >= time_limit
2525
puts "\nSorry, you've run out of time."
2626
puts "You got #{correct} correct, and #{incorrect} incorrect."
27-
puts "Your final grade is #{(((correct+incorrect).to_f/correct)*100).round}%"
27+
puts "Your final grade is #{((correct/(correct+incorrect).to_f)*100).round}%"
2828
exit
2929
end
3030
end
@@ -43,5 +43,4 @@ def passed
4343
puts "I'm sorry, the correct answer was #{num1 + num2}."
4444
end
4545
end
46-
4746
end

0 commit comments

Comments
 (0)