Write a program that computes the cost of a long-distance call. The cost of the call is
Question:
Write a program that computes the cost of a long-distance call. The cost of the call is determined according to the following rate schedule:
Any call started between 8:00 A.M. and 6:00 P.M., Monday through Friday, is billed at a rate of $0.40 per minute.
Any call starting before 8:00 A.M. or after 6:00 P.M., Monday through Friday, is charged at a rate of $0.25 per minute.
Any call started on a Saturday or Sunday is charged at a rate of $0.15 per minute.
The input will consist of the day of the week, the time the call started, and the length of the call in minutes.
The output will be the cost of the call.
For example, an execution could look like this: Enter the day the call started at: Fri
Enter the time the call started at (hhmm): 2350
Enter the duration of the call (in minutes): 22 This call will cost $5.5
And this is what i wrote:
day=input("Enter the day the call started at:")
time=int(input("Enter the time the call started at (hhmm):"))
duration=int(input("Enter the duration of the call (in minutes):"))
if day == "Mon" or "Tue" or "Wed" or "Thr" or "Fri":
print("This call will cost"+str(0.40*duration))
elif day == "Mon" or "Tue" or "Wed" or "Thr" or "Fri":
print("This call will cost"+str(0.25*duration))
else:
print("This call will cost"+str(0.15*duration))
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang