Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Problem 3 Write a function named call cost that computes the cost of a long-distance call. The cost of the call is determined according

image text in transcribed

python

Problem 3 Write a function named call cost 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:00am and 6:00pm, Monday through Friday, is billed at a rate of $0.40 per minute. . Any call started before 8:00am or after 6:00pm, 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 function will take three parameters: one indicating the day of the week when the call started, one indicating the time the call started, and one indicating the length of the call in minutes. The function will then return the price of the call in dollars as a float. The time will be given as four-digit int, representing the time in 24-hour notation, so the time 1:30pm is given as 1330. The value 1 represents one minute after midnight The day of the week will be given as one of the following three-character strings: Mon Tue, Wed, Thu. Fri, Sat, or Sun The number of minutes will be given as a positive integer. The function's signature will therefore be str, int, int -> float. For example, to determine the cost of a call beginning at 11:30pm on a Friday and lasting 22 minutes, we could make the following call: print (call_cost ("Fri", 2350, 22)) The above statement should output 5.5, signifying a cost of $5.50

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago