The small island of Barracuda (a former British colony in the Carribean)
is about to get its very first Taco Bell franchise. The island is
so small that the franchise will be a Taco Bell Express, offering a very
limited menu. To save money on employees, the franchise owner has
decided to automate the ordering by having customers enter their orders
at a keyboard. You are to write the program which handles a customer
order - recognizing what the customer wants, tallying up the cost
(including taxes which are 6% of the purchase price) and giving change
in Barracuda currency. The program is to be used once for each customer.
The monetary unit on Barracuda is the Barracuda Pound (labeled BP) which consists of 100 pence. There are three coins that are used: the kaurto worth 40 pence, the quince worth 15 pence, and the triad worth 3 pence. The island has long since given up on using coins of one pence. Consequently, when people make purchases, businesses give change using the three common coins and come as close as they can to the exact amount to be returned. Whenever that is not possible, businesses always "round down" the cost so that it is in the customer's favor.
Your program must repeatedly prompt the customer by asking him/her what
s/he wants. There are only five items on the menu; their names and
costs in BPs is given below.
| Taco | BP 0.79 |
| Toastada | BP 0.89 |
| Burrito | BP 1.29 |
| Quesadilla | BP 2.09 |
| Drink | BP 1.09 |
The customer is expected to enter the name of an item being ordered (in all lowercase letters - there is no shift key on their keyboard). Your program must recognize the names of the items and keep a running tally of the cost (this tally should be shown to the customer). When the customer wants two or more of one item, that item's name must be entered more than once. When the customer is finished making an order, s/he must enter the word "end" at the keyboard. When your program recognizes the "end" entry, it should compute the total cost of the order (by adding in the tax) and ask the customer for money. When the customer enters the amount tendered at the keyboard, your program should display a message telling the customer what change will be paid. Your program must do this by displaying the number of pounds, kaurtos, quinces, and triads that will be used to make the change.
Below is a sample of what a transaction might look like. The entries in bold represent elements typed by the customer; everything else would be displayed by the program. As you can see, your program must also handle situations in which the customer makes a spelling error. Your program need not display the exact words shown below; however, it should certainly calculate the same cost and give the same change for the purchase of two tacos and a drink when BP 5 is tendered.
Welcome to Taco Bell
Express. Enter the names of the items you want to
purchase. Enter
end to conclude your transaction.
What would you like?
taco
Cost so far is
BP 0.79
What else would you like?
taco
Cost so far is
BP 1.58
What else would you like?
drnik
This item is not recognized.
Cost so far is
BP 1.58
What else would you like?
drink
Cost so far is
BP 2.67
What else would you like?
end
That all comes to
BP 2.83
How much are you paying?
5.00
Your change consists
of:
2 pounds.
1 quinces.
1 triads.
You should test your program to be sure that all of the five items work, that your program handles error situations, and that it produces correct results. You should hand in a printout of your well-commented program (generated by doing a Print in Visual C++) and, as you did in the previous project, capture the execution output showing the display when a customer purchases two toastadas, one quesadilla, and one drink, paying for it all with BP 10 (have the customer make some mistake during the entry). Hand in a printout of the output also. Name the .cpp file after yourself and copy it to the hand-in folder at
P:\courses\spring2002\cosc\cosc110\003\hand-in