Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLE HELP ME BY PYTHON PLE HELP ME BY PYTHON Part 3: Phone Plan The cost of one type of phone service is $9.38 plus

PLE HELP ME BY PYTHON

image text in transcribed

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: 59.43 Cost for plan 2: $9.48 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_costohas 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

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

friendliness and sincerity;

Answered: 1 week ago