Name:  ___________________                      February 11, 2003

Queens College - CS211                                  Instructors: John Donath, Yosef Alayev

 

Quiz #1 Version D

 

Note:   This quiz is open book/open notes.

 

Directions:  Please complete the quiz by writing valid C++ source code representing .h and .cpp files, as discussed in class.  All code in the .h file must be commented according to the guidelines mentioned for the course.  For the purposes of this quiz, the .cpp files need not be commented.  Please write your code on this sheet of paper, you may use your own paper if you need more space.  Also, please write your final answer using a pen.

 

1.  Write a .h file for a class that declares an instance of a class, Restaurant.  This class should store the name of the restaurant, its specialty, and the average price a customer pays for a meal.  It should have a constructor that solicits the user to enter the information stored in the class.  It should also have two accessor functions, one for average price per meal, and one for the specialty of the restaurant. (2 points)

 

2.  Write the .cpp file for the class described above (1.5 points)

 

3.  Write a program that will input 13 restaurants from the user, (store them in an array).  It should then print out the specialty of the cheapest and most expensive restaurants. (1.5 points).