Computer Science 161

Exercise set #10

Due: Various


I. search.cpp

The best way to start this project is to copy class.cpp to search.cpp, and simply add some code to the back of search.cpp.

 

Extend class.cpp by adding code so that, after the class list has been printed, the program asks the user for the name of a student to search for, and then uses a binary search to search for that student in the class. If the student is found in the class, the details of that student should be printed. If the student is not found in the class, an error message should be printed.

 

Important note: Please do not add features to assigned problems. Asking the user if they want to do this again, for example, will cause problems with my grading program and may result in delay in getting your program back to you (or its return with a request to correct and resubmit).

 

Due: Thursday, April 29 (Poincare's birthday!)


II. object.cpp

Using the code in search.cpp, create a new program called object.cpp with the following:

Due: Wednesday, May 5 (Last day of classes!)


Please let me know if you have any questions. Many thanks!