Question: PLE HELP ME BY PYTHON Part 3: Phone Plan The cost of one type of phone service is $9.38 plus 4.5 cents for each unit

 PLE HELP ME BY PYTHON Part 3: Phone Plan The cost

PLE HELP ME BY PYTHON

Part 3: Phone Plan The cost of one type of phone service is $9.38 plus 4.5 cents for each unit used over 65 units. The cost of a second type of phone service is $8.57 plus 5.2 cents for each unit used over 50 units. Write a program called Lastname_firstname_phone.py that will: Ask the user for number of units used (integer). Calculate and display the cost for the units using the first plan. Calculate and display the cost for the units using the second plan. Tell which plan is cheaper. [The amounts for the two plans will never be exactly equal when the units are integers.] Your program must display all monetary amounts with dollar signs and exactly two digits after the decimal point. Here is a sample of what the output might look like when the program is run several times. Your output does not have to look exactly like this, but it must convey the same information. Enter number of units used: 45 Cost for plan 1: $9.38 Cost for plan 2: $8.57 Plan 2 is cheaper. Enter number of units used: -3 You cannot have negative units. Enter number of units used: 66 Cost for plan 1: $9.43 Cost for plan 2: $9.40 Plan 2 is cheaper. Enter number of units used: 75 Cost for plan 1: $9.83 Cost for plan 2: $9.87 Plan 1 is cheaper. Your program must have at least two functions. The first one, get_units has no parameters. This function asks the user for a number of units and returns that number. (Your main program will check if the number is negative or not.) The second function, calculate_cost() has four parameters: The number of units The base cost of the plan The number of units that the base cost pays for (the "base limit") The cost per unit when you go over the base limit. The calculate_cost() function returns the cost, given those parameters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!