Question: 3. Using Nested if statements, write an interactive program named EnoughTimeForLunch that accepts four integers hourl, minutel, hour2, and minute2 as inputs. Each pair of

 3. Using Nested if statements, write an interactive program named EnoughTimeForLunch

3. 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 gap 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 between 0 and 23, and the minute are between 0 and 59. You may also assume that 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) true EnoughTimeForLunch (12, 30, 13, 00) false EnoughTimeForLunch (12, 30, 13, 15) true EnoughTimeForLunch (14, 20, 17, 02) true EnoughTimeForLunch (12, 30, 9, 30) EnoughTimeForLunch (12, 00, 11, 55) false false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!