CS 230 Fall 2004                                                           Assignment 7 – Procedures and Functions                                                          100 points

Assigned: 10/19/2004

Due: 10/28/2004 at the start of class (Note, we will have a new assignment for lab on 10/27)

 

Pre-Lab (Do Before Lab):  Bring a new disk. Plan out tasks, objects, and events needed for program. Plan out major pseudocode

 

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 procedure to handle validation of inputs, and functions 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.

 

Hand in:

 

Miscellaneous:

               “Basic” customer

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

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

·        Additional songs streamed - $0.20 each

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

·        Additional songs downloaded - $2.00 each

               “Regular” customer

·        Base monthly cost - $20 – 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 - $1.00 each

               “Premium” customer

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

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

·        Additional songs streamed - $0.05 each

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

·        Additional songs downloaded - $0.50 each

·        MAKE SURE YOUR PROGRAM WORKS! (i.e. gets the correct answers). Now that our program is branching , we need to try more examples to make sure they work. Think, “what different possibilities need to be checked?” For each, calculate the correct answer by hand and see if your program gets it!

·        Put YOUR NAME, and e-mail address in comments at the beginning of the program.

·        You MUST include comments that explain your program in order to get full credit.

·        Remember to use meaningful variable names, and indent to show the structure of the program (VB usually does this correctly).

·        Try to use good user interface design. Make clear what user needs to do and what the answers mean.