so i have this problem that is asking me to finish a test class and fill in the blanks basically and ive drawn a few blanks just asking for some help
(10 points on a test)
Test class
Variables
private ArrayList<Problem> probList;
Constructors
//probList should be empty
public Test()
//probList should be populated by
public Test(Problem[] probs)
Methods
//add problem to the end of test
public void addProblem(Problem prob)
/*
Should return a string containing each question, numbered and separated by a line.
Example:
What is 5+5?
Who won the Civil War?
A. The North
B. The South
C. Your Mom
*/
public String toString()
//Returns the percent of answers answered correctly.
//Precondition: answers.length == probList.size()
//Values of answers may be null
public int gradeTest(String[] answers)
/*
Returns a numbered list of answers:
10 A
*/
public String answerKey()
Aucun commentaire:
Enregistrer un commentaire