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

 

fixGradesArray


You are writing a grade "fixing" program to "help" [insert rival school] students compete with your school! Given an array that contains a set of integer scores, calculate the mean (average) and then modify the array as follows: Any grade above average gets cut in half. Any grade below average gets doubled, but has a maximum of 100. Return the modified array when you are done. Write a helper method to calculate the mean of the scores.


fixGradesArray([]) → []
fixGradesArray([80, 80, 90, 90, 70, 70]) → [80, 80, 45, 45, 100, 100]
fixGradesArray([0, 0, 0, 0, 0, 0]) → [0, 0, 0, 0, 0, 0]

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

public int[] fixGradesArray(int [] scores){ }

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

Copyright Nick Parlante 2017 - privacy