In: Computer Science
Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of services: regular and premium. Its rates vary depending on the type of service. The rates are computed as follows:
Regular service: $10.00 plus the first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute.
Premium Service: $25.00 plus
Your program should output the type of service, number of minutes the telephone service was used, and the amount due from the user.
For the premium service, the customer may be using the service during the day and night. Therefore, to calculate the bill, you must ask the user to input the number of minutes the service was used during the day and the number of minutes the service used during the night.
IN PYTHON PLEASE
NOTE : PROGRAMS ARE DONE WITH PYTHON PROGRAMMING LANGUAGE.
INDENTATION IS ONE OF THE MAJOR ISSUE OF PYTHON PROGRAMMING. IF THERE IS ANY PROBLEM IN INDENTATION, KINDLY REFER TO THE SCREEN SHOT OF THE PROGRAM, BELOW THE TEXT BASED SOURCE CODE. AS SCREEN SHOT IS IMAGE BASED , SO THE INDENTATION IS SHOWN PERFECTLY IN SCREEN SHOT. IF REQUIRED, CAN REFER THE INDENTATION FROM SCREEN SHOT AND MODIFY THE PROGRAM SOURCE CODE.THE CODE IS GIVING EXACT OUTPUT.
PROGRAM
ch =1
# loop will run until ch is 3
while(ch!=3):
print("\nCellular Telephone Company")
print("1.Regular service :")
print("2.Premium service :")
print("3.Exit :")
# input choice
ch=int(input("Enter the choice : "))
# if choice is 1
if(ch==1):
m=int(input("Number of minutes the telephone service was used :
"))
if(m>50):
chrg = 10 + (m-50)*0.20
else:
chrg=10
print("\nBILL DETAILS \n")
print("Type of service : Regular ")
print("Number of minutes the service was used :" ,m)
print("Amount due from the customer : $",chrg)
#if choice is 2
if(ch==2):
d=int(input("Number of minutes the service was used during morning
: "))
n=int(input("Number of minutes the service was used during night :
"))
if(d>75):
chrgd=(d-75)*0.10
else:
chrgd=0
if(n>100):
chrgn=(n-100)*0.05
else:
chrgn=0
chrg=25+chrgd+chrgn
print("\nBILL DETAILS \n")
print("Type of service : Premium ")
print("Number of minutes the service was used during day :"
,d)
print("Number of minutes the service was used during night :"
,n)
print("Amount due from the customer : $" , chrg)
# if choice is 3 , exit from program
if(ch==3):
print("Exit from the program...")
SCREEN SHOT
OUTPUT