Write a Python program that determines cell phone charges (problem #1 in quiz 00 with the stipulation that the user can use their phone < 300 minutes. Recall that problem 1 reads as follows: Suppose your cell phone carrier charges you a monthly fee of $30.00 for up to 300 minutes and $0.45 for each additional minute after the first 300. Assuming you used your phone for x minutes with x > 300, the total monthly fee would be? If you used your phone for <= 300 minutes then the charge is $30.00 Assume the user enters a positive value for the number of minutes

Respuesta :

Answer:

#Here is program in Python

#read the minutes

minutes=int(input("Please enter the minutes:"))

#charge if minutes <=300

if minutes<=300:

   m_charge=30

# charge if minutes>300

else:

   m_charge=30+(minutes-300)*0.45

#print the charge

print("monthly charge is: $",m_charge)

Explanation:

Read the total used minutes of month and assign it to variable "minutes".If theused minutes are less or equal to 300 then monthly charge is $30.If the used minutes are greater then 300 then for first 300 minutes charge is $30 and for additional minutes multiply by 0.45 and sum them.This will be the monthly charge.

Output:

Please enter the minutes:310

monthly charge is: $ 34.5

ACCESS MORE