UMBC CS 201, Spring 03
UMBC CMSC 201 Spring '03 CSEE | 201 | 201 S'03 | lectures | news | help

CMSC 201
Programming Project One

B & E Catering

Out: Tuesday 2/25/03
Due Date: before midnight, Wednesday 3/5/03

The Objective

The objective of this assignment is to get you familiar with good design practices, writing in C in a Unix environment, and using functions.

The Background

Ms. Block and Mrs. Evans have just started a morning snack catering business called B & E Catering Company. The company caters to groups of 8 to 1000 and offers either doughnuts or mini-muffins.

Research was done by the company before opening to make filling customers' orders as simple as possible for both the clerk and the customer. When a customer calls, they need only specify the number of guests expected and whether they would like doughnuts or mini-muffins to be served.

The Task

You have been hired by "B & E Catering" to write a program that allows a clerk to give customers price quotes over the phone. Since the clerk may receive one request for quotation after another the program should process quote after quote until the clerk decides to quit the program. Your program should be menu-driven, asking the clerk to choose to price a doughnut order, a muffin order, or to quit the program.

You will find the following information useful. Research has shown that :

You MUST use constants (#define) for each of the consumption rates shown above, as well as the current prices of both doughnuts and mini- muffins. You must use constants for your menu choices, the number of items in a dozen, minimum and maximum valid entries from the menu, minimum and maximum valid entries for the number of guests being served, and for the current state sales tax rate.

Your program MUST include the following functions. Do NOT change the function prototypes given below. You may choose to use more functions if you wish, but these are sufficient.

More Details

Additional Specifications

Sample Run

linux1[101] gcc -Wall -ansi proj1.c linux1[102] a.out Your greeting goes here 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 8 ------------------------------------------------------------------------------ Doughnut order for 8 people 1 dozen Mixed doughnuts at $7.99/dozen 7.99 Comprised of : 8 chocolate covered & 4 glazed ---------------------- Subtotal 7.99 Tax 0.40 ---------------------- Total 8.39 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 16 ------------------------------------------------------------------------------ Doughnut order for 16 people 1 dozen Chocolate covered doughnuts at $7.99/dozen 7.99 1 dozen Mixed doughnuts at $7.99/dozen 7.99 Comprised of : 4 chocolate covered & 8 glazed ---------------------- Subtotal 15.98 Tax 0.80 ---------------------- Total 16.78 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 25 ------------------------------------------------------------------------------ Doughnut order for 25 people 2 dozen Chocolate covered doughnuts at $7.99/dozen 15.98 1 dozen Glazed doughnuts at $7.99/dozen 7.99 ---------------------- Subtotal 23.97 Tax 1.20 ---------------------- Total 25.17 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 26 ------------------------------------------------------------------------------ Doughnut order for 26 people 2 dozen Chocolate covered doughnuts at $7.99/dozen 15.98 1 dozen Glazed doughnuts at $7.99/dozen 7.99 1 dozen Mixed doughnuts at $7.99/dozen 7.99 Comprised of : 8 chocolate covered & 4 glazed ---------------------- Subtotal 31.96 Tax 1.60 ---------------------- Total 33.56 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 35 ------------------------------------------------------------------------------ Doughnut order for 35 people 3 dozen Chocolate covered doughnuts at $7.99/dozen 23.97 1 dozen Glazed doughnuts at $7.99/dozen 7.99 1 dozen Mixed doughnuts at $7.99/dozen 7.99 Comprised of : 4 chocolate covered & 8 glazed ---------------------- Subtotal 39.95 Tax 2.00 ---------------------- Total 41.95 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 1 Please enter the number of guests : 1001 We can only place orders for 8 to 1000 guests Please enter the number of guests : 7 We can only place orders for 8 to 1000 guests Please enter the number of guests : -2 We can only place orders for 8 to 1000 guests Please enter the number of guests : 0 We can only place orders for 8 to 1000 guests Please enter the number of guests : 1000 ------------------------------------------------------------------------------ Doughnut order for 1000 people 83 dozen Chocolate covered doughnuts at $7.99/dozen 663.17 41 dozen Glazed doughnuts at $7.99/dozen 327.59 1 dozen Mixed doughnuts at $7.99/dozen 7.99 Comprised of : 4 chocolate covered & 8 glazed ---------------------- Subtotal 998.75 Tax 49.94 ---------------------- Total 1048.69 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 8 ------------------------------------------------------------------------------ Mini-Muffin order for 8 people 1 dozen Banana Nut Muffins at $6.99/dozen 6.99 1 dozen Mixed Muffins at $6.99/dozen 6.99 Comprised of : 6 cranberry orange & 6 lemon poppyseed ---------------------- Subtotal 13.98 Tax 0.70 ---------------------- Total 14.68 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 20 ------------------------------------------------------------------------------ Mini-Muffin order for 20 people 2 dozen Banana Nut Muffins at $6.99/dozen 13.98 1 dozen Cranberry Orange Muffins at $6.99/dozen 6.99 1 dozen Lemon Poppyseed Muffins at $6.99/dozen 6.99 ---------------------- Subtotal 27.96 Tax 1.40 ---------------------- Total 29.36 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 21 ------------------------------------------------------------------------------ Mini-Muffin order for 21 people 2 dozen Banana Nut Muffins at $6.99/dozen 13.98 1 dozen Cranberry Orange Muffins at $6.99/dozen 6.99 1 dozen Lemon Poppyseed Muffins at $6.99/dozen 6.99 1 dozen Mixed Muffins at $6.99/dozen 6.99 Comprised of : 6 banana nut, 3 cranberry orange & 3 lemon poppyseed ---------------------- Subtotal 34.95 Tax 1.75 ---------------------- Total 36.70 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 101 ------------------------------------------------------------------------------ Mini-Muffin order for 101 people 10 dozen Banana Nut Muffins at $6.99/dozen 69.90 5 dozen Cranberry Orange Muffins at $6.99/dozen 34.95 5 dozen Lemon Poppyseed Muffins at $6.99/dozen 34.95 1 dozen Mixed Muffins at $6.99/dozen 6.99 Comprised of : 6 banana nut, 3 cranberry orange & 3 lemon poppyseed ---------------------- Subtotal 146.79 Tax 7.34 ---------------------- Total 154.13 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 102 ------------------------------------------------------------------------------ Mini-Muffin order for 102 people 11 dozen Banana Nut Muffins at $6.99/dozen 76.89 5 dozen Cranberry Orange Muffins at $6.99/dozen 34.95 5 dozen Lemon Poppyseed Muffins at $6.99/dozen 34.95 1 dozen Mixed Muffins at $6.99/dozen 6.99 Comprised of : 6 cranberry orange & 6 lemon poppyseed ---------------------- Subtotal 153.78 Tax 7.69 ---------------------- Total 161.47 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 2 Please enter the number of guests : 1000 ------------------------------------------------------------------------------ Mini-Muffin order for 1000 people 104 dozen Banana Nut Muffins at $6.99/dozen 726.96 52 dozen Cranberry Orange Muffins at $6.99/dozen 363.48 52 dozen Lemon Poppyseed Muffins at $6.99/dozen 363.48 1 dozen Mixed Muffins at $6.99/dozen 6.99 Comprised of : 6 banana nut, 3 cranberry orange & 3 lemon poppyseed ---------------------- Subtotal 1460.91 Tax 73.05 ---------------------- Total 1533.96 ---------------------- ------------------------------------------------------------------------------ 1 - Order Doughnuts 2 - Order Muffins 3 - QUIT Please enter your menu choice : 4 Please try again. Valid choices are between 1 and 3 : 0 Please try again. Valid choices are between 1 and 3 : -5 Please try again. Valid choices are between 1 and 3 : 3 Closing Ordering Program linux1[103]

Although your output need not be identical to the above, all information (including the greeting) must be present.

Submitting the Program

You must name your source file proj1.c

To submit your project, type the following at the Unix prompt:

submit cs201 Proj1 proj1.c

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show all files that you submitted in a format similar to the Unix 'ls' command.

submitls cs201 Proj1


CSEE | 201 | 201 S'03 | lectures | news | help

Thursday, 27-Feb-2003 14:13:24 EST