CPSC-115 Spring 2008
Project 2
Professor Heidi Ellis

Algorithm due 11:20 a.m. Tuesday September 23, 2008 (15 points)
Program due 10:50 a.m. Thursday September 25th, 2008 (35 points)


Pairs:

Kristen Anderson, Jeffrey Young       Catherine Doyle, Ryan Ersland
Jake Elder, Corazon Irizarry, Chelsea Bainbridge-Donner     Nick Dragu, Jesse Vazquez
Jin Feng Liu, Greg Vaughan     Zain Khan, John Wilsterman

PLAGIARISM: READ THIS CAREFULLY!
You are working in pairs for this assignment. The work you submit should be done entirely by you and your partner. It is assumed that you and your partner worked on every aspect of the program together. In this case a single copy of the program is be handed in. Make sure that all team members have a copy of the project.

This does not mean that you cannot talk to classmates about your work. It is okay to discuss in general how you are tackling a particular problem -- e.g., "I used a String to store the value input by the user." You may also give help to or receive help from a classmate about a particular error message or program bug. "That error means you must have forgotten a semicolon."

However, you may not copy another person's code or solution, whether from a classmate or from someone who took the course before or from someone you find on the Internet, in whole or in part, either by hand or electronically, and submit it as your own. If you need help with either design or programming, you should consult with the Instructors or TAs or with the CPSC Study Hall Consultants. If you receive substantial help from another student or a TA or an Instructor, you must document it in your program's header by providing the name of the person who helped you and a brief description of the type of help you received. Getting help on an assignment and not documenting it is a form of plagarism.


Deliverables:

You must provide the following:

Objective:

The goal of this project is to exercise conditionals including a switch statement by calculating the charges for a health center client for a month.

You are to write a program that calculates the monthly charge to be paid by a client of the health club. Clients may sign up for three different plans that have different base rates and different privileges. The monthly charge is calculated based on the base rate, plus a charge for all classes taken beyond the number of classes included in the base rate. The plans are listed below:

  1. Basic Plan (B): The base rate for the Basic Plan is $20/month. Clients have unlimited use of the exercise equipment. Clients in this plan may take ten classes a month for free and are charged $30 per class for any classes taken beyond ten classes.
  2. Privileged Plan (P): The base rate for the Privileged Plan is $40/month. Clients have unlimited use of the exercise equipment and tanning. Clients in this plan may take ten classes a month for free and are charged $20 per class for any classes taken beyond ten classes.
  3. Elite Plan (E): The base rate for the Elite Plan is $60/month. Clients have unlimited use of the exercise equipment, tanning, and sauna. Clients in this plan may take ten classes a month for free and are charged $10 per class for any classes taken beyond ten classes. Clients in this plan who take fewer than twelve classes are afforded a 5% discount off their fee.
In addition to the charges outlined above, any client who spends more than $200 per month is given a 10% discount.

Input: The program must take the following information as input from the keyboard:

  1. Name
  2. Age
  3. Driver's license number
  4. Plan type (
  5. Number of classes taken that month
Calculations: You should calculate the client's total charge by:
  1. Start with the base charge for the client's plan.
  2. Add the charge for any additional classes.
  3. Subtract the discount if the client is an Elite member and has taken less than 12 classes.
  4. Subtract the discount if the client's charge is over $200.
Output: The information that should be displayed to the user includes:
  1. All client information as described as input above.
  2. The client's base charge.
  3. Any charges for extra classes.
  4. Any discount if the client is an Elite member. If the client is not an elite member, the elite discount should not show up in the output.
  5. Any volume discount.
  6. The total monthly charge.
A sample run of the program might look like the following (more sample runs found at the bottom of this page):
Enter client name: Ollie Ordinary
Enter client age: 32
Enter client license number: 3293939
Enter the client's plan letter (B, P, or E): P
Enter the number of classes taken: 10

Name: Ollie Ordinary
Age: 32
License: 3293939
Plan: Privileged
MONTHLY CHARGES:
Basic rate: $40.0
Extra class charge $0.0
Volume discount: $0.0
Total charge: $40.0
You must abide by the following:

Grading:

Project 2 will be graded on:

More Sample Test Runs:

Enter client name:  Ella Exerciser
Enter client age:  23
Enter client license number:  3294089o
Enter the client's plan letter (B, P, or E):  E
Enter the number of classes taken:  20

Name: Ella Exerciser
Age: 23
License: 32940890
Plan: Elite
MONTHLY CHARGES:
Basic rate: $60.0
Extra class charge $100.0
Elite discount $0.0
Volume discount: $0.0
Total charge: 160.0

Enter client name: Lazy Leno
Enter client age: 30
Enter client license number: 4902904
Enter the client's plan letter (B, P, or E): B
Enter the number of classes taken: 5

Name: Lazy Leno
Age: 30
License: 4902904
Plan: Basic
MONTHLY CHARGES:
Basic rate: $20.0
Extra class charge $0.0
Volume discount: $0.0
Total charge: 20.0

Enter client name: Regular Ren
Enter client age: 50
Enter client license number: 83939393
Enter the client's plan letter (B, P, or E): P
Enter the number of classes taken: 13

Name: Regular Ren
Age: 50
License: 83939393
Plan: Privileged
MONTHLY CHARGES:
Basic rate: $40.0
Extra class charge $60.0
Volume discount: $0.0
Total charge: 100.0

Enter client name: Ready Rollo
Enter client age: 20
Enter client license number: 32323232
Enter the client's plan letter (B, P, or E): B
Enter the number of classes taken: 25

Name: Ready Rollo
Age: 20
License: 32323232
Plan: Basic
MONTHLY CHARGES:
Basic rate: $20.0
Extra class charge $450.0
Volume discount: $47.0
Total charge: 423.0

Enter client name: Willa Warmup
Enter client age: 60
Enter client license number: 3290343
Enter the client's plan letter (B, P, or E): E
Enter the number of classes taken: 3

Name: Willa Warmup
Age: 60
License: 3290343
Plan: Elite
MONTHLY CHARGES:
Basic rate: $60.0
Extra class charge $0.0
Elite discount $3.0
Volume discount: $0.0
Total charge: 57.0