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

 

abraskin@mbusd.org problemset04 > adjGrade
prev  |  next  |  chance

After a test or an assignment, a teacher allows students to complete a make-up assignment that can increase their score by up to half the points they failed to earn on their original grade. Write a method that calculates the students new grade if the complete the make-up assignment. Optionally, a teacher can specify a minimum number of points the make-up assignment is worth. For example: Students completed a makeup assignment after a recent exam that was worth 88 points. If they did the makeup assignment they would earn at least another 5 points:

A student scored a 74/88: adjGrade(74,88,5)=81.0
Another student scored 61/88: adjGrade(61,88,5)=74.5
Another student scored 84/88: adjGrade(84,88,5)=89.0
The parameters are:
double grade
The students original grade
double outOf
The maximum grade on the assignment
double minAdjust
The minimum points awarded for completing the makeup assignment.

adjGrade(74, 88, 5) → 81.0
adjGrade(61, 88, 5) → 74.5
adjGrade(84, 88, 5) → 89.0

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

double adjGrade(double grade, double outOf, double minAdjust) { }

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: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy