id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

abraskin@mbusd.org > improvedScore
prev  |  next  |  chance

A teacher allows student to complete an assignment after taking an exam to improve their exam score if they choose.


Completing the assignment earns the student half the points they failed to earn when they originally took the exam but they can't earn less than 5% of the total points possible.

Therefore, a student that gets an 80 out of 100 can earn an additional 10 points bringing their new score up to 90 while a student that score 95 out of 100, will end up with a score of 100 because the fewest points that can be earned on a 100 point test is 5!

This does mean that it is possible to earn a score that is higher than 100%.

Write a method with two parameters, the original score and the highest possible score that calculates the improved score if the student completes the assignment.

improvedScore(99, 99) → 103.95
improvedScore(50, 100) → 75.0
improvedScore(98, 100) → 103.0

...Save, Compile, Run (ctrl-enter)

public double improvedScore(int originalScore, int possibleScore) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy