CS1302
Programming Assignment#2
8/16/2018
MyCourse2
Fares
I.
Things you will learn in doing this project:
1.
Arrays
2.
Use some of the String class methods
3.
Better understanding of classes and objects.
II.
Programming Part:
1.
Revise the attached Course class (Named it Course2) as follows:
a.
Default array size is 4.
b.
Implement the addStudent method. Method should accepts student’s name and a location.
Check for full array and invoke doubleArraymethod that doubles the size of array and copy
original records to the new one. If location is negative, do nothing. If location is greater than
numberOfStudents, insert at end of records. Otherwise, insert at entry location.
Make sure you shift records right.
c.
Implement dropStudent method.Method should search for the student in the array, if found,
shift records left and adjust number of students.
d.
Add a new method named clear() that removes all students from the course.
e.
Implement a findStudentLocation method that accepts a student’s name and returns its
location if found, otherwise, it returns -1.
