This is the question and my code in under neath: Cell Phone Bill Calculator Writ
ID: 3633616 • Letter: T
Question
This is the question and my code in under neath:Cell Phone Bill Calculator
Write the Python code for the following programming problem definition.
Use modular design according to the modules specified below.
Design and write a program that calculates and displays the number of minutes over the monthly contract minutes that a cell phone user incurred. The program should ask the user how many minutes were used during the month and how many minutes they were allowed. Validate the input as follows:
The minimum minutes allowed should be at least 100, but not greater than 700. Validate input so that the minutes allowed are between 100 and 700.
•The minutes used must be over 0. Validate input so that the user does not enter a negative value.
Once correct data is entered, the program should calculate the number of minutes over the minute allowed. If minutes were not over, print a message that they were not over the limit. If minutes were over, for every minute over, a .15 fee should be added to the monthly contract rate of 64.95. Be sure not to add the .15 fee to the number of minutes allowed, but rather just minutes over. Display the number of minutes used, minutes allowed, the number of minutes over, and the total due that month.
Use the following functions in your program design:
•A function that allows the user to enter in minutes allowed within the range of 100 and 700.
•A function that allows the user to enter in the minutes used greater than or equal to 0.
•A function that calculates the total due and the total minutes over.
•A function that prints a monthly use report.
Your sample output might look as follows (note the validation code):
Sample 1 Showing Validation:
How many minutes are allowed: 1000
Please enter minutes between 100 and 700
How many minutes are allowed: 801
Please enter minutes between 100 and 700
How many minutes are allowed: 350
How many minutes were used: -10
Please enter minutes used of at least 0
How many minutes were used: 400
You were over your minutes by 50
---------------MONTHLY USE REPORT------------------
Minutes allowed were 350
Minutes used were 400
Minutes over were 50
Total due is $ 72.45
Do you want to end program? (Enter no or yes): NO
Please enter a yes or no
Do you want to end program? (Enter no or yes): 9
Please enter a yes or no
Do you want to end program? (Enter no or yes): no
Sample 2 Showing Minutes Over:
How many minutes are allowed: 600
How many minutes were used: 884
You were over your minutes by 284
---------------MONTHLY USE REPORT------------------
Minutes allowed were 600
Minutes used were 884
Minutes over were 284
Total due is $ 107.55
Do you want to end program? (Enter no or yes): no
Sample 3 Showing Minutes Not Over:
How many minutes are allowed: 400
How many minutes were used: 379
You were not over your minutes for the month
---------------MONTHLY USE REPORT------------------
Minutes allowed were 400
Minutes used were 379
Minutes over were 0
Total due is $ 64.95
Do you want to end program? (Enter no or yes): yes
def main():
while(True):
allowed=int(input("How many minutes are allowed?: "))
while(not minAllowed(allowed)):
print("Please enter minutes between 100 and 700: ")
allowed=int(input("How many minutes are allowed?: "))
used=int(input("How many minutes were used?: "))
while(not minUsed(used)):
print("Please enter minutes used of at least 0")
used=int(input("How many minutes were used?: "))
over=totalOver(allowed,used)
if(over>0):
print("You were over your minutes by " +str(over))
else:
over=0
print("You were not over your minutes for the month.")
printReport(allowed,used,over)
toEnd=input("Do you want to end program? (Enter no or yes): ")
toEnd=toEnd.rstrip(' ')
while((toEnd != "yes") and (toEnd!= "no")):
print ("Please enter a yes or no")
toEnd=input("Do you want to end program? (Enter no or yes): ")
if(toEnd== "yes"):
break
def printReport(allowed,used,over):
print("---------------------MONTHLY USE REPORT--------------------")
print("Minutes allowed were "+str(allowed))
print("Minutes used were "+str(used))
print("Minutes over were " + str(over))
print("Total due is $ " + str(totalDue(over)))
def minAllowed(min):
if(min >= 100) and (min <= 700):
return True
else:
return False
def minUsed(min):
if(min >= 0):
return True
else:
return False
def totalOver(allowed,used):
return (used - allowed)
def totalDue(over):
return (64.95 + (0.15*over))
Explanation / Answer
check this link. http://www.dreamincode.net/forums/topic/158357-how-do-i-convert-python-into-raptorflowchart/
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.