CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXTest 2
Test 2 – Chapter 3-6 and 17
This test covers the first 11 weeks of class, which covers chapter 3, 4, 5, 6 and 17 with an emphasis on
chapters 4-6.
YOUR PROGRAM
An International Internet phone company has three different subscription packages for its customers:
Package A:
For $9.95 per month 5 hours of call time are provided. Additional usage costs
$0.08 per minute.
Package B:
For $14.95 per month 10 hours of call time are provided. Additional usage costs
$0.06 per minute.
Package C: For $19.95 per month unlimited call time is provided.
Write a program in C# that calculates a customer's monthly bill. It should ask the user to enter the
customer name, which package the customer has purchased, and how many hours were used. The
program should then create a bill (format it like bill) that includes the input information and the total
amount due. Wherever possible, use named constants instead of numbers. Display bill on screen.
Input Validation: Be sure the user only selects package A, B, or C.
The program should also display how much money Package A customers would save if they purchases
packages B or C, and how much money package B customers would save if they purchases package C.
(Use a switch statement for this) If there would be no savings, no message should be printed.
The user will get the option to try again (Try again? ‘Y’/’N’). If they enter ‘N’, the program will stop,
while if they enter ‘Y’, the program will start from the beginning.
When they enter ‘N’, the program will print out the formatted bill to a file called “MyBill.txt”.
When you are done, you will submit the .cs file via Blackboard.