Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON Write a program that includes the function getTimeName(hours, minutes) that returns the English name for a point in time, such as ten minutes past
PYTHON Write a program that includes the function getTimeName(hours, minutes) that returns the English name for a point in time, such as "ten minutes past two", "half past three" "a quarter to four" or "five o'clock." Assume that hours is between 1 and 12.
Required Considerations:
- test if the time is "special" and name it accordingly:
- x:00 is "o'clock"
- x:15 is "quarter after"
- x:30 is "half past"
- x:45 is "quarter til"
- if the minute is 40 or less, it's "after"
- x:40 is "forty past x"
- x:22 is "twenty two past x"
- if the minute is 41 - 59, it's "before"
- x:49 is "11 until..." (you figure this part out)
- x:42 is "18 until..." (you figure this part out)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started