Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Description Your have a cell phone and after a month of use, you are trying to decide which price plan is the best for

image text in transcribedimage text in transcribedimage text in transcribed

Assignment Description Your have a cell phone and after a month of use, you are trying to decide which price plan is the best for your usage pattern. There are 4 plan options available A, B, C, or D. All plans have the same base price of $10 per month that should be added to the plan costs indicated below. Free minutes are for day time only. Evening and week-end minutes are always at a cost. each plan has different costs for daytime minutes, evening minutes and weekend minutes. Costs Plan Daytime Evening Weekend A 100 free minutes, then 15/minute 20c/minute 25/minute 200 free minutes, then 20/minute 25c/minute 30/minute 250 free minutes, then 30/minute 35c/minute 40c/minute D $39 for unlimited minutes. unlimited unlimited B Program Menu Your program will display a simple menu that will ask the user whether s/he wants to evaluate a given cellphone plan or exit the program. Your program continues until the user requests to exit the program. Your program must display the following Menu: Welcome to My Cellphone Calculator 1. Evaluate a plan 2. Exit Enter your selected option : Adapted from the Canadian Computer Competition, 2005. 1 Description of Menu Options 1. The program asks the user to input the number of each type of minutes from current or anticipated usage. The input will be in the order of daytime minutes, evening minutes and weekend minutes. The program outputs the price for each plan according to the entered usage pattern in the format shown below. The program also determines the cheapest plan and prints an appropriate message. The program returns to main menu after completing the option for one plan. 2. Exit the program. Example 1 Number of daytime minutes? 254 Number of evening minutes? 10 Number of weekend minutes? 60 Plan A costs $50.10 Plan B costs $41.30 Plan C costs $38.70 Plan D costs $49.0 choose Plan C. Example 2 Number of daytime minutes? 162 Number of evening minutes? 71 Number of weekend minutes? 71 Plan A costs $51.25 Plan B costs $49.05 Plan C costs $63.25 Plan D costs $49.0 Choose Plan D. Example 3 Number of daytime minutes? 260 Number of evening minutes? 20 Number of weekend minutes? 70 Plan A costs $55.5 Plan B costs $48.0 Plan C costs $48.0 Plan D costs $49.0 Choose Plan B or C. Defining constant Variables Define constant variables for the constant values used to represent each calling plan. This will make your program more self-explanatory and also easier to modify if values change in the future. For example, to define the first calling plan, your code should contain the following block: BASE_PRICE = 10 # Base price for all plans in dollars. A_FREE = 100 # Plan_A Number of free daytime minutes per month. A_DAYTIME = 15 # Plan_A Cost of additional daytime minutes, in cents. A_EVENING = 20 # Plan_A Cost of evening minutes, in cents. A_WEEKEND = 25 # Plan_A Cost of weekend minutes, in cents. Some hints for your program: To determine the best plan, you will need several if statements or you may use any other tools as seen in class. Test the given examples and follow the example output as closely as possible. 2

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

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

To what extent is news constructed or created?

Answered: 1 week ago