0 votes
133 views
in Python by (98.9k points)
edited
Write a program that prompts the user to input number of calls and calculate the monthly telephone bills as per the following rule:

Minimum Rs. 200 for up to 100 calls. . Plus Rs. 0.60 per call for next 50 calls. . Plus Rs. 0.50 per call for next 50 calls. . Plus Rs. 0.40 per call for any call beyond 200 calls.

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
# calculate your monthly bill for telephone

call = int(input("Enter your number of calls for this month: "))

if call <= 100:
 bill = 200


elif 100 < call <= 150:
 addon = call - 100
 bill = 200 + 0.60 * addon


elif 150 < call <= 200:
 addon = call - 150
 bill = 200 + 0.60 * 50 + 0.50 * addon

else:

 addon = call - 200
 bill = 200 + 0.60 * 50 + 0.50 * 50 + 0.40 * addon

print("Total bill For this month is Rs", bill)

Related questions

0 votes
1 answer 211 views
0 votes
1 answer 114 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...