Question

In: Computer Science

Write a program that calculates and prints the bill for a cellular telephone company. The company...

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

  1. For calls made from 6:00 A.M. to 6:00 P.M., the first 75 minutes are free; charges for over 75 minutes are $0.10 per minute.
  2. For calls made from 6:00 P.M. to 6:00 A.M., the first 100 minutes are free; charges for over 100 minutes are $0.05 per minute.

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

Solutions

Expert Solution

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


Related Solutions

In Python write a program that calculates and prints out bills of the city water company....
In Python write a program that calculates and prints out bills of the city water company. The water rates vary, depending on whether the bill is for home use, commercial use, or industrial use. A code of r means residential use, a code of c means commercial use, and a code of i means industrial use. Any other code should be treated as an error. The water rates are computed as follows:Three types of customers and their billing rates: Code...
Write a pyhton program that reads a stream of bits, e.g. 11001, and calculates and prints...
Write a pyhton program that reads a stream of bits, e.g. 11001, and calculates and prints the decimal value of the binary number represented by the entered bits, i.e. 25 in this case.
jgrasp environment, java write a complete program that calculates a restaurant bill. Prompt the user for...
jgrasp environment, java write a complete program that calculates a restaurant bill. Prompt the user for the check amount, then ask the user what type of tipp they would like to leave: the choices are 1 for good tip (20%), 2 for an average tip (15%), or 3 for poor tip (10%). Use their input and an if-else to calculate the tip amount. Then calculate and output the final bill: check+tip print out the bill, exactly as shown (print the...
User asks you to develop a program that calculates and then prints interest earned on a...
User asks you to develop a program that calculates and then prints interest earned on a bank balance. Program should print interest earned for the same balance when interest is accumulated annually, semiannually and quarterly. I need the C++ code!
Write a program that asks the user for an integer. The program checks and prints to...
Write a program that asks the user for an integer. The program checks and prints to the screen whether the number is prime or not. For example, if user enters 17, the program should print “17 is prime”; if the user enters 20, the program should print “20 is not prime”. please do it with a “ while Loop”, Thanks..
Please use Phyton to write a program: Write a program that calculates and displays the total...
Please use Phyton to write a program: Write a program that calculates and displays the total bill at a restaurant for a couple that is dining. The program should collect from the couple, cost of each meal, and the percentage of the final cost that they would like to tip. The sales tax in the state where the restaurant exists is 7.5%. Display to the user, line by line: Total Cost of Both Meals Sales Tax in dollars Tip in...
(Tokenizing Telephone Numbers) Write a program that inputs a telephone number as a string in the...
(Tokenizing Telephone Numbers) Write a program that inputs a telephone number as a string in the form (555) 555-5555. The program should use function strtok to extract the area code as a token, the first three digits of the telephone number as a token and the last four digits of the phone number as a token. The seven digits of the phone number should be concatenated into one string. The program should convert the area-code string to int and convert...
Write a program in c++ that maintains a telephone directory. The Telephone directory keeps records of...
Write a program in c++ that maintains a telephone directory. The Telephone directory keeps records of people’s names and the corresponding phone numbers. The program should read a transaction file and report the result into an output file. The transaction file can include commands such as “Add”, “Delete”, “Display”, and “Update”, and “Search”. Each command is written in one line with a few other information. The “Display” Command should simply display everyone in the directory on the screen The “Add”...
Write a program that calculates the salary of employees. The program should prompt the user to...
Write a program that calculates the salary of employees. The program should prompt the user to enter hourly rate and number of hours of work a day. Then, the program should display the salary daily, bi-weekly (5 days a week), and monthly. Sample program: Enter your hourly rate: >>> 20 Enter how many hours you work a day: >>> 8 Your daily salary is: $160 Your bi-weekly salary is: $1600 Your monthly: $3200
Write a program that calculates the balance of a savings account at the end of a...
Write a program that calculates the balance of a savings account at the end of a three month period. It should ask the user for the starting balance and the annual interest rate. A loop should then iterate once for every month in the period, performing the following: Ask the user for the total amount deposited into the account during that month. Do not accept negative numbers. This amount should be added to the balance. Ask the user for the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT