Modify the GradeBook class of Fig.7.16 so that the constructor accepts as parameters the number of students

Question:

Modify the GradeBook class of Fig.7.16 so that the constructor accepts as parameters the number of students and the number of exams, then builds an appropriately sized two-dimensional array, rather than receiving a preinitialized two-dimensional array as it does now. Set each element of the new two-dimensional array to -1 to indicate that no grade has been entered for that element. Add a setGrade method that sets one grade for a particular student on a particular exam. Modify class GradeBookTest of Fig.7.17 to input the number of students and number of exams for the GradeBook and to allow the instructor to enter one grade at a time.

Fig.7.16

I // Fig. 7.16: GradeBook.java // GradeBook class using a two-dimensional array to store grades. 2 3 4 5 6 7Fig.7.171 // Fig. 7.17: GradeBookTest.java 2 // GradeBookTest creates GradeBook object using 3 // of grades, then

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: