Answered step by step
Verified Expert Solution
Question
1 Approved Answer
exam = False sunny = False sunblock = False morning _ classes = True night _ classes = True raining = False rain _ jacket
exam False
sunny False
sunblock False
morningclasses True
nightclasses True
raining False
rainjacket True
snowing False
friendsaregoing True
fluffycoat False
snowboots True
reallywanttogo True
#You may modify the lines of code above, but don't move them!
#When you Submit your code, we'll change these lines to
#assign different values to the variables.
#Imagine you commute to your classes and want to write code to
#determine when it is appropriate for you to go to class based
#on the following conditions:
#
# If you have an exam, then you should go to class, regardless
# of the weather.
# If you do not have an exam and it is sunny outside, then you
# want to go to class if either of the following are true: you
# have sunblock and your classes are in the morning or your
# classes are at night.
# If you do not have an exam and it is raining outside, then
# you want to go to class if you have a rain jacket.
# If you do not have an exam and it is snowing, then you want
# to go if any of the following are true: your friends are
# going and you have a fluffy coat, you have snow boots and a
# fluffy coat, or you just really want to go to class.
#If none of the previously stated conditions are true, then you
#do not want to go to class.
#Once you have determined if you should go to class, print the
#following statement without the quotation marks, where
#corresponds to the boolean that you have found:
#"True or false: I should go to class:
#Add your code here! #With the initial inputs, your code
#should print:
#True or false: I should go to class: False
shouldgotoclass sunnysunblock and morningclasses or nightclasses rainingrainjacket snowing friendsaregoing and fluffycoat or snowboots and fluffycoat or reallywanttogo
printTrue or false: I should go to class:", shouldgotoclass
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