Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago