CS 230 Fall 2006                                                Assignment 8 – More Sub Procedures and Function Procedures                            100 points

Assigned: 10/25/2006

Due: Fri 11/03/2006 at the start of class (Note, we will have a new assignment for lab on 11/2)

Pre-Lab (Do Before Lab):  Bring a new disk. Plan out tasks, objects, and events needed for program. Plan out major pseudocode. Put some thought into this. The more clever you are, the less code you will write on this assignment.

Main Assignment:

E-Tunes Inc is working on a new program in conjunction with the new “pay for music” era. Your program is a simplification dealing with customer billing. The program should get from the user the number of songs “streamed” (played on-line without saving) and number downloaded (saved to disk). The program should have buttons to allow 3 different calculations – one for if the customer is a “premium” customer, one for if they are a regular customer, and one for if they are a “basic” customer. For pricing details, see below. The program should call a function procedure to handle validation of inputs, and function(s) to calculate the cost if the inputs are valid.  The program should also have a button to allow the user to explore “what-if” – to see what their activity would cost under all 3 plans. This button’s processing should include calling the same procedures and functions as the individual calculations!! (hence an advantage for using procedures/ functions!!!)  Display the appropriate answers in labels or text boxes (locked of course).  Provide capabilities for the four calculation options, plus to clear the input and output to start again, and to exit.

This assignment is intentionally designed to reward use of procedures and functions. You must write some sub procedures and function procedures for this assignment (and use them!)

Hand in:

Miscellaneous:

                “Basic” customer

·         Base monthly cost - $5 – always, no matter use

·         First 200 songs streamed “free” (included in monthly fee)

·         Additional songs streamed - $0.10 each

·         First 10 songs downloaded “free” (included in monthly fee)

·         Additional songs downloaded - $2.00 each

                “Regular” customer

·         Base monthly cost - $10 – always, no matter use

·         First 400 songs streamed “free” (included in monthly fee)

·         Additional songs streamed - $0.05 each

·         First 20 songs downloaded “free” (included in monthly fee)

·         Additional songs downloaded - $1.00 each

                “Premium” customer

·         Base monthly cost - $25 – always, no matter use

·         First 1000 songs streamed “free” (included in monthly fee)

·         Additional songs streamed - $0.03 each

·         First 50 songs downloaded “free” (included in monthly fee)

·         Additional songs downloaded - $0.50 each