CS 1401 Assignment #11

Date Assigned: Monday, November 12, or Tuesday, November 13, 2007.

Due Date: Monday, November 19, or Tuesday, November 20, 2007, before the beginning of your lab section.

Objective: The main objective of this assignment is to learn to use inheritance.

Programming assignment: The task is the same as in the previous Assignments 9 and 10: Write a program for helping waiters. This program must allow the user to enter the names of different menu items (foods or drinks), the amount of each item, and the price of each item. Assume that the number of different items does not exceed 100. Your program must store all this data, and then print the detailed menu including the information about all the items plus the following information:

Main difference: In the previous assignment 10, we advised you to define a class FoodItem whose objects contain three fields:

More and more students are now vegetarian, so they also want to know whether the food items are vegetarian or not. To be able to store this additional information, design a new class FoodItemsVeg which contains a new field: a true-false variable indicating whether a food item is vegetarian. Use inheritance to design this new class. Use objects of the new type in your program.

Deliverables: as instructed by your TA.