Name: __________________                                                                          September 18-19, 2002

 

CS211                                                                                                                     Instructors: Yosef Alayev, John D. Donath

 

 

Quiz #1, Version A

 

 

 

Note:  This quiz is open book / open notes.

Grading:  This quiz will be graded out of 5, with the point value written after each part.

 

Directions:  Answer the questions on the quiz paper and on the back.  Be sure to specify which questions you are answering.  You should use a permanent ink pen; however, if you choose to use a pencil or erasable ink, you waive your right to discuss grading of the quiz after it has been returned.

 

1.  Write the .h file for a class that represents a book.  Information that the class keeps track of should include the author as a c-string that can hold 35 letters, title as a c-string that can hold 25 letters, and an isbn number that is an integer.  These variables should be set by three mutator functions.  There should also be an accessor function for ISBN number, and a function to output to the screen the information stored in the class.  [1.5 points]

 

2.  Write the .cpp file for the class [1.5 points]

 

3.  Write a program that intializes an array of 100 books, and keeps reading in books from the user and storing them in the array until either the array is full, or the user enters 0 for the ISBN of the next book. [2 points]