IUP Computer Science
COSC 110      Fall 05
 


Project #3
(Cheap Publishers)
(Due  14 October 2005)

Cheap Publishers is a copying and printing business, sort of a rival of Copies Now or Pro Packets.  But, Cheap Publishers specializes in making booklets and packets, especially small ones;  they claim to have the cheapest prices anywhere.  They get so much booklet business that they have decided to automate the process of ordering by allowing customers to use a simple computer program to enter their own orders and be told the prices.  You are to write the program to accept the customer orders and calculate the prices.

The customer will use a keyboard which is rigged to enter only lowercase letters and digits.  When a customer comes to the keyboard, your program should greet him/her and then ask a series of questions to determine the nature of the order, and to determine its cost.  Your program may ask these questions in any order you wish, not just in the order shown below.

  1. How many pages are in the item?   Here the customer is expected to enter a number.  The program is not required to verify the entry.
  2. What color is the paper?  Five colors are allowed. White paper is the cheapest (2.2 cents per page); Yellow and Pink paper costs 2.5 cents per page; and Blue and Green paper costs 2.8 cents per page.  The program must make sure the color entered is one of the five allowed; if it is not, the program must display an error message and give the customer one more try at entering a valid color.  If the second try is not valid, the program should display another error message and end execution.
  3. Whether the booklet has a cover or not?  If the booklet has a cover, it adds 20 cents to the cost of each booklet.  The program should get a yes or no answer from the customer, maybe just a y or an n.
  4. Whether the booklet is spiral bound or stapled?  The program should require the customer to enter b for bound or s for stapled; or maybe just use b for bound and take anything else as meaning s.  Spiral binding adds 50 cents to the cost of each booklet; stapling adds 5 cents to the cost.
  5. How many copies are to be made?  Here the customer is expected to enter a number.  The program is not required to verify the entry.
With the information entered, the program should calculate the cost of a single booklet and then the cost of the entire order.  Then, it should calculate the sales tax (6% of the cost of the order) and the total price and display all of this information.  For example, if the customer indicates that the booklet has  50 green pages, a cover and is stapled and that s/he wants 100 copies, the program should make the calculations and display something like this.

100 booklets of 50 green pages, stapled with a cover.
That comes to $165.00 with $9.90 tax, for a total of $174.90

The program should then ask the customer if s/he has another order and expect a yes/no (y/n) response.  If s/he does have another order, the program should go through the questions again for the new order and make a similar display.  For example, if the customer's second order is for a 40 copies of a 73 page booklet on white paper with a cover and spiral bound, the program should display something like

40 booklets of 73 white pages, bound with a cover.
That comes to $92.24 with $5.53 tax, for a total of $97.77

When the customer indicates that there are no more orders, the program should display a grand total price for everything ordered.  For the two examples given, the last display should look something like this.

The grand total is $272.67

Hand in a Visual Studio generated printout of your well documented program and a printout of the output generated for a customer who makes the orders that I will specify two days before the project is due.  Copy your source file (which should be named after yourself) to the appropriate handin folder on the P: drive.