Description
Problem:
Your have been asked by a cell phone service provider to write a program that will
calculate the amount of the “talk” portion of a customer’s monthly cell phone bill. Write
a C++ program that will calculate the amount of the bill given which talk plan the
customer subscribes to and how many voice minutes they used during the month.
The cell phone service provider offers the following talk plans:
Package A: 450 minutes for $39.99. .45/minute for each additional minute.
Package B: 900 minutes for $59.99. .40/minute for each additional minute.
Package C: Unlimited minutes for $69.99.
Input:
Use the following menu to prompt the user for the customer’s cell phone plan:
Talk Plans:
A. The 450 minute plan
B. The 900 minute plan
C. The unlimited plan
Enter which talk plan the customer subscribes to:
Then ask the user to input the number of voice minutes used in the month.
For both inputs, use an if statement to perform input validation. The user should select
only A, B, or C from the menu, and the minutes should be between 0 and 44640
(inclusive). If their input is invalid, ask them to enter the value again.
Processing: Compute the amount of the monthly bill according to the plan
descriptions above.
Additionally, for package A customers compute how much money they would have
saved this month a) if they had purchased package B instead and b) if they had
purchased package C instead. For package B customers, compute how much money
they would have saved this month if they had purchased package C instead.
Output: Display the amount of the monthly bill with a dollar sign and formatted to 2
decimal places. Also if the customer would have saved any money by purchasing
another plan (as calculated above) output the amount of savings for the other plan(s).
If the savings are 0 or negative for a given plan, no message should be
printed.
Talk Plans:
A. The 450 minute plan
B. The 900 minute plan
C. The unlimited plan
Enter which talk plan the customer subscribes to: B
Enter the total number of minutes used during the month: 875
The amount due for the month is $59.99
Talk Plans:
A. The 450 minute plan
B. The 900 minute plan
C. The unlimited plan
Enter which talk plan the customer subscribes to: D
Please enter A, B, or C: A
Enter the total number of minutes used during the month: 550
The amount due for the month is $84.99
Amount saved if you were on Plan B: $25.00
Amount saved if you were on Plan C: $15.00
Additional Requirements:
• Use named constants for all literals!!
• Use proper data types (only use float or double when necessary).
• Grading Threshold: Your program must compile and run, and pass the
following 5 test cases, otherwise you will receive a 0.
Plan A, 400 minutes : amount due is $39.99
Plan A, 480 minutes : amount due is $53.49
Plan B, 900 minutes : amount due is $59.99
Plan B, 920 minutes : amount due is $67.99
Plan C, 1000 minutes: amount due is $69.99
(there are no savings for these test cases)
Style:
See the Style Guidelines document on the course website. The grader will deduct
points if your program violates the style guidelines. Make sure it is indented neatly.
Logistics:
Name your file assign4_xxxxx.cpp where xxxxx is your TX State NetID (your
txstate.edu email id). The file name should look something like this: assign4_js236.cpp
There are two steps to the turn-in process:
1. Submit an electronic copy using the Assignments tool on the TRACS website for
this class (tracs.txstate.edu). Submit the .cpp file, (NOT a .cbp file!).
2. Submit a printout of the source file at the beginning of class on the day the
assignment is due. Please print your name on the front page, and staple if there
is more than one page.
See the assignment turn-in policy on the course website (cs.txstate.edu/~js236/cs1428)
for more details.

