Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#Positive numbers indicate a time ahead of UTC. Together, you * Can use these to find how many hours apart you and your friend fare.

image text in transcribed
\#Positive numbers indicate a time ahead of UTC. Together, you * Can use these to find how many hours apart you and your friend fare. For example, if your time zone is 4 and your friend's 1s 4-7, you are 11 hours apart: you're 4 hours ahead of UTC, and \#your friend is 7 hours behind UTC, which makes 11 total. Himy_time indicates the current time in your local time zone; \#you can ignore minutes, 80,5 represents 5:00. For simpliolty, the ' 11 use military time, so my_time ranges from 0 to 23 . \#Your goal is to determine which of the following is true: - You and your friend are on the same calendar day; if this is true, you should print "Today". - Your friend is one day behind you; if this is true, you should print "Yesterday". - Your friend is one day ahead of you; if this is true, you should print "Tomorrow". "You can tell which is the case by finding the difference \#between your time zone and your friend's time zone and applying *it to your current local time. If the result is negative, your Hfriend is a day behind you, and you would print "Yesterday". *if the result is greater than 23, your friend is a day ahead of "you, and you would print "Tomorrow. If neither is true, you \#would print "Today". Hor example, if your time zone is t4, and your friend's is 7, then they are 11 hours behind you. If the locsl time for you Iis 5(5:00), then the local time for your friend is 11 hours *earlier, which would be 6:00 the day before, so you would \#print "Yesterday". \#HINT: While you may use conditionals, you don't need them. *Remember that you can multiply a string by 0 to erase the *string, and remember that False acts as 0 when used in \#mathematical expressions. \#Add your code here

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago