11. Given the following variables, determine whether each expression is True or False. a = 1 b = 5 c = -1 my_bool = False; а. a —с and aа

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter4: Making Decisions
Section: Chapter Questions
Problem 19RQ
icon
Related questions
icon
Concept explainers
Question
100%
11. Given the following variables, determine whether each expression is True or False.
a
1
b = 5
= -1
my bool = False;
а.
a
—с and а <b
==
b.
not (not my bool)
с.
b < c and 2 < b
d.
(not my bool and (c < b or a == b))
or not my bool
е.
my bool and ((a < b and c < b) and c < 0)
Transcribed Image Text:11. Given the following variables, determine whether each expression is True or False. a 1 b = 5 = -1 my bool = False; а. a —с and а <b == b. not (not my bool) с. b < c and 2 < b d. (not my bool and (c < b or a == b)) or not my bool е. my bool and ((a < b and c < b) and c < 0)
Expert Solution
Explanation

Here we have a = 1, b = 5, c = -1 and my_bool = false

a. We are comparing the value using "and" so when both the operation will be true then only the expression will be true.

b. We have used the "not" operator which is used to reverse the value which is false then it will be set to true and vice-versa.

c. Here also we have the "and" operator which will return true if both the subexpression result in true.

d. Here first of all the expression inside the brackets is solved and then the result is solved with the "and", "or", "not" operator.

e. Here also the expressions inside the brackets are solved and then the outer expression is solved.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT