What is the value of the relation expression below, given that x is 5 and y is 1. z is a bool.
z = x < y;
a. true
b. false
c. 1
d. 0
e. None of the above, you can't assign result of expression, only test it
Answers for C++ Course using "Starting out with C++ : from control structures through objects" by Tony Gaddis. 7/8th ed. I used the Pearson myprogramminglab to complete the homework. Here are my solutions/answers for the exercises/labs so please use the test bank as a GUIDE if you're stuck. Let me know if you find a better solution to a problem or any of the programming challenges. Thanks in advance for your support! Send in missing programming challenges to cplusplus.answers@gmail.com
Chapter 4 Quiz Starting Out With C++ 007
(bonus question) How does C++ handle true or false with regards to storing these values. Mark all that apply, if any
a. only a 1 is equal to true.
b. only 0 is considered true.
c. a 0 is considered false.
d. anything other than 0 is considered true.
e. None of the above, they are stored as T or F.
Remember the lecture from Monday on making decisions and you'll do fine.
a. only a 1 is equal to true.
b. only 0 is considered true.
c. a 0 is considered false.
d. anything other than 0 is considered true.
e. None of the above, they are stored as T or F.
Remember the lecture from Monday on making decisions and you'll do fine.
Exericse Number
Chapter 04,
Quiz
Chapter 4 Quiz Starting Out With C++ 006
In the following, what is the value of the expression given that the value of x is 5?
x == 5
a. x
b. 5
c. false
d. true
x == 5
a. x
b. 5
c. false
d. true
Exericse Number
Chapter 04,
Quiz
Chapter 4 Quiz Starting Out With C++ 005
What does the ! (exclamation symbol) mean in c++?
a. It tells the compiler to check this condition first
b. It means not or the opposite of what the comparison is.
c. It is a shortcut so you don't have to enter 'true' or a relational comparison operator
d. None of the above
a. It tells the compiler to check this condition first
b. It means not or the opposite of what the comparison is.
c. It is a shortcut so you don't have to enter 'true' or a relational comparison operator
d. None of the above
Exericse Number
Chapter 04,
Quiz
Chapter 4 Quiz Starting Out With C++ 004
What is the difference between = and == in C++?
a. They are the same but the == makes it more visible to the programmer
b. == is used to assign a value to a variable and = is used to compare.
c. = is used to assign a value to a variable.
d. == is used for comparison and = is used to assign
a. They are the same but the == makes it more visible to the programmer
b. == is used to assign a value to a variable and = is used to compare.
c. = is used to assign a value to a variable.
d. == is used for comparison and = is used to assign
Exericse Number
Chapter 04,
Quiz
Chapter 4 Quiz Starting Out With C++ 003
How do you write "greater than or equal to" test in c++?
a. gte
b. > or =
c. >=
d. > && =
a. gte
b. > or =
c. >=
d. > && =
Exericse Number
Chapter 04,
Quiz
Subscribe to:
Posts (Atom)