IUP Computer Science
COSC 110 Spring 2008
Project #3
Sheets Sale
(Due 29 February 2008)
Sheets R Us, a company that specializes
in linen sales at the lower end of the market, is opening a new automated
store to sell sheets and pillow cases. Your job is to write a program
to deal with the customers who enter their orders through one of the store's
order stations (containing a monitor, a keyboard and a display of patterns).
Sheets R Us sells individual sheets, fitted or flat, pillow cases, and
bedding sets(two sheets and two pillow cases) for all standard sized
beds. The base cost for a standard King set using material that contains
300 threads per square inch is $70. For a similar Queen set, it is
$60; for a Full set, it is $50; and for a Twin set, it is $40.
Your program needs to greet the customer
and then ask a series of questions (prompts) to determine the cost of the
items being ordered. Specifically, the program needs to do the following:
-
Determine what size sheet is being ordered.
The possible sizes are King, Queen, Full, and Twin. The program must
accept one of these four words as the size. If the customer enters
anything else, the program should tell the customer that the entry is invalid
and give the customer a second chance. If the second customer try
is also invalid, the program should terminate after telling the customer
s/he is wrong. Your program is not required to validate any
input other than the sheet size.
-
Determine if the customer wants a set (containing
a flat sheet, a fitted sheet, and two pillow cases) or just one of these
three components. The program may allow the customer to enter one
word to indicate whether s/he wants a set or a component, by entering
a word such as "set", "flat", "fitted", or "cases". Altermatively,
the program may assume that anything other than the word "set" is one of
the components. For each of the three components, the cost is 40%
of the base cost of a set. Thus, a Queen size fitted sheet or pillow
cases costs $24 (40% of $60).
-
Determine the thread count for the sheets.
300 is the standard. If the customer asks for a thread count that
is less than that, deduct 20% from the cost. If the customer asks
for a thread count that is more than 300, add 30% to the cost. Thus,
a Queen size fitted sheet with thread count of 400 costs $31.20 and a Queen
size set with thread count 400 costs $78.
-
Determine how many sheets or specified components
the customer wants.
-
Ask the customer for the pattern number; there
are 64 patterns. The program should accept any integer number for
this value. All patterns cost the same.
-
Then, display in a clear way the cost of the
order, the tax (at 6% sales tax), and the total price is. Below is
a sample output to illustrate a clear display. Your display does
not need to have this exact form; but it must be clear, showing dollars
and cents and what the item ordered is. Here, the item is just referred
to as a "fitted-sheet"; you may want to identify specifically "flat-sheet",
"fitted-sheet", or "pillow-case-pairs"; but all of these are the same price;
so, you may also refer to any of these three generically as "component".
2 Queen size fitted-sheets in pattern 23 with thread count of 400
Cost $ 62.40
Tax $ 3.74
Price $ 66.14
Thus, the output might look like the following
instead.
2 Queen size components in pattern 23 with thread count of 400
Cost $ 62.40
Tax $ 3.74
Price $ 66.14
After displaying this report, your program
should ask the customer if s/he wants to make another order. If the
customer answers yes, the program must do the steps again. This must
repeat until the customer indicates that there are no more orders.
When that happens, the program must display the total price for
all items ordered.
Approximately three days before the project
is due, I will give you a list of orders from one customer. Execute
your program on the inputs that I provide and generate the item cost/tax/price
and the total price.
Hand in a well-documented printout of your
program and a printout of the captured output from the order that I give
you, showing the specifications for each item ordered. Also, copy
the program's .cpp file to the handin folder on the P: drive for COSC 110,
your section. Be sure to name the .cpp file after yourself
so that it can be distinguished from other student file names. For
example, I would name my file
wolfep3.cpp