Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Your have been asked by a mobile phone service provider to write a program that will calculate the amount of the voice portion of

image text in transcribed
image text in transcribed
image text in transcribed
Problem: Your have been asked by a mobile phone service provider to write a program that will calculate the amount of the voice portion of a customer's monthly bill. Write a C++ program that will calculate the amount of the bill given which voice plan the customer subscribes to and how many minutes they used during the month. The mobile phone service provider offers the following voice 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 voice plan: Voice Plans: A. The 450 minute plan B. The 900 minute plan C. The unlimited plan Enter which voice 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, output an error message and exit the program (do not ask the user to re-enter the value). 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. Sample output: Voice Plans: A. The 450 minute plan B. The 900 minute plan c. The unlimited plan Enter which voice 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 Voice Plans: A. The 450 minute plan B. The 900 minute plan c. The unlimited plan Enter which voice plan the customer subscribes to: A Enter the total number of minutes used during the month: 501 The amount due for the month is $62.94 Amount saved if you were on Plan B: $2.95 Voice Plans: A. The 450 minute plan B. The 900 minute plan C. The unlimited plan Enter which voice plan the customer subscribes tot D Enter the total number of minutes used during the month The voice plan entered is invalid. 303 Voice Plans A. The 450 minute plan Voice Plans: A. The 450 minute plan B. The 900 minute plan c. The unlimited plan Enter which voice plan the customer subscribes to: A Enter the total number of minutes used during the month: 44641 That is not a valid amount for the minutes. Additional Requirements: Your program must compile and run, otherwise you will receive a score of o. Use appropriate data types. Use int unless you know the value could have non-zero digits after the decimal point. Your program must output the correct values given any valid input values. Style: See the Style Guidelines document on the class website. In particular: Named constants: use these for numeric literals, and use uppercase and underscores in their names. Hint: there are several in this program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started