CS 230 Spring 2005                                                          Assignment 7 – Procedures and Functions                                   100 points

Assigned: 03/14/2005

Due: 03/21/2005 at the start of class

 

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

 

Main Assignment:

USA Cellular is working on a new program in conjunction with their billing plans. The program should get from the user the number of prime time minutes, and the number of evening/weekend minutes.  The program should have buttons to allow 2 different calculations – one for if the customer is a “premium” customer, and one for if they are a regular customer. For pricing details, see below. The program should call a procedure(s) 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 BOTH 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 three calculation options, plus to clear the input and output to start again, and to exit.

 

Hand in:

 

Miscellaneous:

                “Regular” customer

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

·         First 500 primetime minutes “free” (included in monthly fee)

·         Additional primetime minutes  - $0.10 each

·         First 3000 evening/weekend minutes “free” (included in monthly fee)

·         Additional evening/weekend minutes - $0.05 each

                “Premium” customer

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

·         First 1000 primetime minutes “free” (included in monthly fee)

·         Additional primetime minutes - $0.05 each

·         First 10000 evening/weekend minutes “free” (included in monthly fee)

·         Additional evening/weekend minutes - $0.02 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!

·         You must turn on Option Explicit and Option Strict.

·         Put YOUR NAME, e-mail address, date and purpose 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).

·         Put your name on the form as a Label or as part of the form title.

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