UMBC CMSC 202
UMBC CMSC 202 CSEE | 202 | current 202

Project 1

Welcome to Goodburger!

Posted: Monday 2/4/02
Design Document Due Date: design1.txt is due before midnight, Sunday 2/10/02
Project Due Date: Before midnight, Sunday 2/17/02


Objectives


Project Description

As the title says, "Welcome to Goodburger!" Goodburger is the newest fast food restaurant in the University Commons. It offers a variety of drinks, entrees, side orders, and desserts at student (and faculty) affordable prices. To keep its prices low, Goodburger would like to automate its serving system in accordance with the Sample Run below. The specification is not too fancy yet, but if you do a good job, they just might hire you to do the one million dollar upgrade.

Well, this job doesn't seem too tough. After all, you have worked with files, basic sorting, and menus before. But Kel, the owner of Goodburger, is a little different. He insists that the program contain no for, while, or do-while statements! It's a good thing that you are now an expert in recursion.

Further Specification

As stated, your program may contain NO loops in order to receive 100% credit. That means no for loops, while loops, do loops, goto statements, or any other syntax that can implement looping. You may use only recursive function calls to implement looping.

In addition,

Assumptions

You may assume the following:


A Sample Run

linux2[1]% Proj1 food1.dat Input file is empty. linux2[2]% Proj1 food2.dat Welcome to Goodburger, home of the Goodburger. May I take your order? Here's our menu: 1) brownie $ 1.75 2) cheeseburger $ 2.75 3) cola $ 1.25 4) cole slaw $ 0.99 5) diet cola $ 1.25 6) french fries $ 1.25 7) ginger ale $ 1.25 8) hamburger $ 2.50 9) hot dog $ 1.50 10) ice cream cone $ 1.90 11) ice cream sundae $ 2.10 12) milk $ 1.35 13) onion rings $ 1.45 14) orange soda $ 1.25 15) pie $ 1.65 16) potato chips $ 1.50 17) salad $ 2.25 18) water $ 0.75 Which item would you like? 2 Would you like another item? (y or Y) y Here's our menu: 1) brownie $ 1.75 2) cheeseburger $ 2.75 3) cola $ 1.25 4) cole slaw $ 0.99 5) diet cola $ 1.25 6) french fries $ 1.25 7) ginger ale $ 1.25 8) hamburger $ 2.50 9) hot dog $ 1.50 10) ice cream cone $ 1.90 11) ice cream sundae $ 2.10 12) milk $ 1.35 13) onion rings $ 1.45 14) orange soda $ 1.25 15) pie $ 1.65 16) potato chips $ 1.50 17) salad $ 2.25 18) water $ 0.75 Which item would you like? 14 Would you like another item? (y or Y) y Here's our menu: 1) brownie $ 1.75 2) cheeseburger $ 2.75 3) cola $ 1.25 4) cole slaw $ 0.99 5) diet cola $ 1.25 6) french fries $ 1.25 7) ginger ale $ 1.25 8) hamburger $ 2.50 9) hot dog $ 1.50 10) ice cream cone $ 1.90 11) ice cream sundae $ 2.10 12) milk $ 1.35 13) onion rings $ 1.45 14) orange soda $ 1.25 15) pie $ 1.65 16) potato chips $ 1.50 17) salad $ 2.25 18) water $ 0.75 Which item would you like? 6 Would you like another item? (y or Y) y Here's our menu: 1) brownie $ 1.75 2) cheeseburger $ 2.75 3) cola $ 1.25 4) cole slaw $ 0.99 5) diet cola $ 1.25 6) french fries $ 1.25 7) ginger ale $ 1.25 8) hamburger $ 2.50 5) diet cola $ 1.25 6) french fries $ 1.25 7) ginger ale $ 1.25 8) hamburger $ 2.50 9) hot dog $ 1.50 10) ice cream cone $ 1.90 11) ice cream sundae $ 2.10 12) milk $ 1.35 13) onion rings $ 1.45 14) orange soda $ 1.25 15) pie $ 1.65 16) potato chips $ 1.50 17) salad $ 2.25 18) water $ 0.75 Which item would you like? 2 Would you like another item? (y or Y) n Here's your bill: cheeseburger $ 2.75 orange soda $ 1.25 french fries $ 1.25 cheeseburger $ 2.75 Your total is $ 8.00 Thank you for eating at Goodburger! linux2[3]%


Sample and Test Data Files

The data file that was used for the sample run above can be found in Ms. Mitchell's public directory. The pathname is:

/afs/umbc.edu/users/s/m/smitchel/pub/CMSC202/p1/food.dat

Remember that this is a sample file only. The file(s) used to test your program may be (and most likely will be) different. However, you have the following guarantees regarding the file(s) used for grading:

So, make sure to test your program thoroughly using your own test data file(s). Note the following when you create a test file(s):


Error Handling

Your program, and ALL programs in this class, must handle the following errors:

For this project, if any of the above errors occur, send a message to the user (via cerr) and exit the program. We will learn other error handling techniques later in the semester.

In addition, for this project, you must check that any menu selections made are within bounds. If not, inform the user and redisplay the menu.


Other Notes

Your program, and ALL programs in this class, should always follow these rules:


Project Make File

The "make" utility is used to help control projects with large numbers of files. It consists of targets, rules, and dependencies. You will be learning about make files in discussion. For this project, the file will be provided for you. Copy the file

/afs/umbc.edu/users/s/m/smitchel/pub/CMSC202/p1/Makefile to your directory. (Note that my user id has a lowercase letter "L", not the number one as the last character.)

When you finish creating all of the required project files (proj1.C, burger.C, and burger.H), you will find that by typing the command make or make Proj1 at the Linux prompt, your project will compile and link (if there are no compiler or linker errors) and produce an executable called Proj1. In addition, typing make clean will remove any extraneous files in your directory, such as .o files and core files. And typing make cleanest will remove all .o files, core, Proj1, and backup files made by the editor.

See the 202 Syllabus for links to more information on make files.


Grading

The grade for this project will be broken down as follows:


Project Submission

You must use separate compilation for this project. You must have a file called proj1.C that contains the function main(). You should also have a burger.C and a burger.H that contain the functions used by proj1.C and the prototypes for those functions, respectively. (Note the uppercase "C" and uppercase "H".) Submit as follows: submit cs202_01 Proj1 proj1.C burger.C burger.H Makefile The order in which the files are listed doesn't matter. However, you must make sure that all files necessary to compile your project (using the make file) are listed.

You can check to see what files you have submitted by typing

submitls cs202_01 Proj1

More complete documentation for submit and related commands can be found here.

Remember -- if you make any change to your program, no matter how insignificant it may seem, you should recompile and retest your program before submitting it. Even the smallest typo can cause compiler errors and a reduction in your grade.



Last Modified: Monday, 04-Feb-2002 11:14:14 EST