100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Programming with C++ Exam 2 Review $10.99   Add to cart

Exam (elaborations)

Programming with C++ Exam 2 Review

 0 view  0 purchase
  • Course
  • Programming with C++
  • Institution
  • Programming With C++

Programming with C++ Exam 2 Review Programming with C++ Exam 2 Review Programming with C++ Exam 2 Review

Preview 2 out of 11  pages

  • October 16, 2024
  • 11
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Programming with C++
  • Programming with C++
avatar-seller
lectjoseph
Programming with C++ Exam 2 Review
Relational operators allow you to ________ numbers. - ANS compare



All of the relational operators are binary.

True or False? - ANS True



The ________ statement causes other program statements to execute only under certain conditions. -
ANS if



To check if a variable has a particular value, use the = relational operator, as in the statement

if (s = 3)

cout << "S has the value 3";

True or False? - ANS False



A pair of characters or a pair of string objects can be compared with any of the relational operators.

True or False? - ANS True



In C++ when a relational expression is false, it has the value - ANS 0.



A(n) ________ is a variable, usually a bool, that signals when a condition exists. - ANS flag



The ________ statement executes one block of statements if a test condition is true, and another block
if the condition is false. - ANS if/else



A trailing else placed at the end of an if/else if statement provides a default action when ________ of
the if conditions is/are true. - ANS none

, When an if statement is placed within the conditionally-executed code of another if statement, this is
known as a(n) - ANS nested if



The rule for matching an else with an if is that an else goes with the last if statement before it that
doesn't have its own else.

True or False? - ANS True



The C++ ________ operator represents logical AND. - ANS &&



If the sub-expression on the left side of an || operator is true, the expression on the right side will not
be checked.

True or False? - ANS True



logical operators AND and OR have a higher precedence than the NOT operator.

True or False? - ANS False



The ________ operator takes an operand and reverses its truth or falsehood. - ANS !



The following C++ test checks if the variable child is in the range 3 to 12.

if (child >= 3 || child <= 12)

True or False? - ANS False



Assuming goodData is a Boolean variable, the following two tests are logically equivalent.

if (goodData == false)

if (!goodData)

True or False? - ANS True

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller lectjoseph. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77988 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.99
  • (0)
  Add to cart