Fall 2006

Clay Shields

front | classes | research | personal | contact

Project 1

PIE, Inc. Wedding Invitation Cost Calculator

Assigned: September 21
Design Due: September 28th
Program source code due: October 5th


Our first project this semester will be to help Pat's Invitation Emporium, Inc. by writing a program that can help them prepare bills for orders that they receive.

Pie, Inc. prints two different types of invitations. They have 5" x 7" smaller invitations or 7" x 7" larger invitations. Each is available in ivory or white. The smaller invitations are $1.49 each, the larger are $1.79 apiece.

To add color, it is possible to add a backing sheet to each invitation so that it will show a border of color around the edge. Colors offered by PIE, Inc. are:

  • Aquamarine
  • Black
  • Burgandy
  • Cobalt Blue
  • Coral
  • Crimson
  • Bubble Gum
  • Ice
  • Pink
  • Navy Blue
  • Pumpkin
  • Sage
  • Sienna
  • Sunflower
  • Pansy
The cost of adding a backing sheet is $0.39 for a small invitation and $0.49 for a large invitation.

Invitations can also be printed using two different colored inks that match the background colors listed above. The cost for using two different inks is $0.75 per invitation.

Finally, the minimum order for invitations is 30, and only in multiples of 10. State law requires that PIE, Inc. charge a 4.75% sales tax on all orders.

Your Assignment

For this project, you will write a program that takes for input the size of the invitations ordered; whether a backing sheet is chosen or not; whether two ink color printing is chosen or not; and the number of invitations ordered. The output should show the total cost of the order, the amount of tax, and the cost of the order with tax. Below is the output of a program that does this:
seva> ./invite
This is the PIE, Inc. Wedding Invitation cost calculator
Please enter the following information:

Enter S for small cards or L for large cards: l
Will there be a backing card (y/n)?: n
Will there be a two ink colors (y/n)?: y
How many invitations are needed?: 40

Card cost subtotal: 101.60
Tax: 4.83
Total with tax: 106.43

You can also run a version of a program that does this yourself, by logging onto seva and typing ~clay/invite. This can be helpful in testing your own program.

Part 1 - Design Document

For the first part you are to submit a design document showing the algorithm you plan to implement. Write it out neatly using a language which is similar to that from Homework 1 and has the following terms:
  1. input
  2. output
  3. calculate
  4. if condition, then statement
  5. if condition, then statement; otherwise, statement
  6. start
  7. stop
If you need to group multiple statements together, say in an if statement, use
A copy of your algorithm is due in class. Be sure to keep a copy for yourself!

Part 2 - Program Source Code

Important: Your output and input should be very similar to that shown in the example program. Please ask for the input in exactly the same order shown and only request the same items shown - do not ask for any other input. This will assist in grading your program.

I expect your program to have the following features, similar to the one that you can run to compare your program to:

  • All input must be checked to make sure it is reasonable. For now, if you detect unreasonable input, the program can just print an error message and halt.
  • You should declare values that are fixed as const and use the declared constants in your calculations.
  • Your output should be neat and aligned similarly to that of the example above and of the example program.

Include the following header in your source code.

// Project 1
// Name: <your name>
// E-mail: <your e-mail address>
// COSC 071
// In accordance with the class policies and Georgetown's Honor Code,
// I certify that I have neither given nor received any assistance
// on this project with the exceptions of the lecture notes and those
// items noted below.
// Description: <Describe your program>

You will submit your source code using the submit program. This is the .cc file. Do not submit the compiled version! I don't speak binary very well.

To submit your program, make sure there is a copy of the source code on your account on seva. You may name your program what you like - let's assume that it is called invite.cc. To submit your program electronically, use the submit program like we did in Homework 2, but with the command:

submit -a p1 -f invite.cc

I will not be enabling the electronic submission until after the design documents are in, so don't try to submit too early.