Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

23. Write a program in a script file that calculates the cost of a telephone cal

ID: 642880 • Letter: 2

Question

23. Write a program in a script file that calculates the cost of a telephone call according to the following price schedule: The program asks the user to enter the time the call is made (day. evening, or night) and the duration of the call (a number that can have one digit to the right of the decimal point). If the duration of the call is not ail integer. the pro gram rounds tip the duration to the next integer. Tile program then displays the cost of the call. Run the program three times for the following calls: (a) 8.3 min at 1:32 P.M. (b) 34.5 miii at 8:00P.M. (c) 29.6minat 1:00 A.M. Command Window: Enter the time the call is made (day, evening, or night) day Enter the duration of the call (in minutes) 8.3 The cost of the call is $ 0.90 Enter the time the call is made (day, evening, or night) evening Enter the duration of the call (in minutes) 34.5 The cost of the call is $ 1.90 Enter the time the call is made (day, evening, or night) night Enter the duration of the call (in minutes) 29.6 The cost of the call is $ 1.00

Explanation / Answer

calltime = input('Enter call time(day, evening, night): ', 's'); callduration = input('Enter call duration: '); callduration = round(callduration); AboveThirty = 0; TentoThirty = 0; TotalCost = 0; if callduration > 30 AboveThirty = callduration - 30; TentoThirty = 20; elseif callduration > 10 && callduration
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote