Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Nested if statements, write an interactive program named EnoughTimeForLunch that accepts four integers hourl, minutel, hour2, and minute2 as inputs. Each pair of parameters
Using Nested if statements, write an interactive program named EnoughTimeForLunch that accepts four integers hourl, minutel, hour2, and minute2 as inputs. Each pair of parameters represents a time on the 24-hour clock (for example, 1:36 PM would be represented as 13 and 36) The program should print "True - Enough Time for Lunch" if the ga between the two times is long enough to eat lunch: that is, if the second time is at least 45 minutes after the first time. Otherwise the program should print "False - Not Enough Time for Lunch". You may assume that all input values are valid: the hours are both betwee 0 and 23, and the minute are between 0 and 59. You may also assume tha both times represent times in the same day, e.g. the first time won't represent a time today while the second time represents a time tomorrow Note that the second time might be earlier than the first time; in such a case, your method should return "False Not Enough Time for Lunch". Here are some example calls to your method and their expected return results Output Input EnoughTimeForLunch (11, 00, 11, 59) EnoughTimeForLunch (12, 30, 13, 00) EnoughTimeForLunch (12, 30, 13, 15) EnoughTimeForLunch (14, 20, 17, 02) EnoughTimeForLunch (12, 30, 9, 30) EnoughTimeForLunch (12, 00, 11, 55) true true true false false
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