Computer Science 261
Assignment # 2
Due: Monday, Sept. 23
Purpose:
- To continue getting comfortable with the JCreator tools
- To review the development of an object
Write a public object called StudentObject which has private fields
for
- StudentNumber (a String)
- StudentName (a String)
- ExamCount (an integer)
- Exams (an array of integers)
- ExamAverage (a double)
- Grade (a char)
With the following public methods
- Constructors
- StudentObject(ExamCnt)
- StudentObject(StudentNumber, StudentName, ExamCnt)
- Inspectors
- getStudentNumber returns String
- getStudentName returns String
- getExamScore(ExamNumber)
- getExamAverage returns double
- getGrade returns char
- toString
- Modifiers
- putExamScore(ExamNumber, ExamScore
- Note: Users are likely to think in terms of exam #1,
exam #2, etc., and the data structure should accomodate
this
You may want a private method called Calculate to compute the exam
average and grade (using 90, 80, 70, 60 percent cutoffs) Please also
write a small main program to test this data structure (no need to
ask the user for input for testing purposes).