Created
December 15, 2020 12:11
-
-
Save mrmemmo/9657a7611c8624d75511e233ec0617c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class SchoolStats | |
{ | |
//list holds scores in increasing order | |
ArrayList<Integer> scoreList = new ArrayList<Integer>(); | |
//holds the total of A's, B's, etc | |
int[] studentScores = new int[4];//first spot is A, then B, etc | |
String[] letters = {"F","C","B","A"}; | |
//A=90-100, B=80-89, C=70-79, F<70 | |
/* | |
* records a score in the scoreList in increasing order | |
* The score will be an int between 0 and 100 | |
* if scoreList contained 57,88,96 and you added 91 | |
* 91 should be placed between 88 and 96 | |
*/ | |
public void record (int score){ | |
} | |
/* | |
* examine the scoreList and | |
* track how many A's, B's, C's & F's | |
* if scoreList contains 57,88,91,95 | |
* After calling distribution() | |
* the studentScores array should hold the following values | |
* 1,0,1,2 | |
*/ | |
public void distribution(){ | |
} | |
/* | |
* recursiveRecord is a recursive method | |
* When it is called it records 10 random scores which are | |
* added to the studentScores list | |
* no loops can be used and must call the record method | |
*/ | |
public void recursiveRecord (int num){ | |
} | |
/* | |
* Helper method that will produce a random number between | |
* b and a | |
* inclusive of min | |
* exclusive of max | |
*/ | |
public int random (int a, int b){ | |
int max=a; | |
int min=b; | |
int random=(int)(Math.random() * (max - min) + min); | |
return random; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment