100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CS161 EXAM QUESTIONS AND ANSWERS | LATEST 2025 | GRADE A+ $13.99   Add to cart

Exam (elaborations)

CS161 EXAM QUESTIONS AND ANSWERS | LATEST 2025 | GRADE A+

 0 view  0 purchase
  • Course
  • CS161
  • Institution
  • CS161

CS161 EXAM QUESTIONS AND ANSWERS | LATEST 2025 | GRADE A+ Assuming goodData is a Boolean variable, the following two tests are logically (goodData == false) if (!goodData) Ans: T When a loop is nested inside another loop, the outer loop goes through all its iterations foreach iteration of t...

[Show more]

Preview 4 out of 31  pages

  • October 23, 2024
  • 31
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CS161
  • CS161
avatar-seller
Lectpearl
HOSMERIT



CS161 EXAM QUESTIONS AND ANSWERS | LATEST
2025 | GRADE A+

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

(goodData == false)

if (!goodData)


Ans: T




When a loop is nested inside another loop, the outer loop goes through all its iterations for each

iteration of the inner loop.

Ans: F




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";


Ans: F




If the operand on the left side of an || operator is true, the expression on the right side will notbe

checked.

,Ans: T




The function main is always compiled first, regardless of where in the program the function

main is placed.

Ans: F,executed




Every include directive must be followed by using namespace std;


Ans: F




All nested if-else statements can be converted into switch statements.


Ans: F




Variable names may begin with a number.


Ans: F




Executable code is computer code that contains no errors.


Ans: F,logic errors

,Functions that do not have a return type are called null functions


Ans: F,void




If a new value is stored in a variable, it replaces whatever value was previously there.

Ans: T




Once a value has been stored in a variable it cannot be changed.


Ans: F,constant




A break statement in a switch stops your program.

Ans: F,switch




A semicolon by itself is a valid C++ statement.

Ans: T




C++ is a case-sensitive language.


Ans: T

, A variable of the char data type can hold a set of characters like "January".

Ans: F,string




The following two C++ statements perform the same operation.

regWages = regPay + overTime;regPay + overTime = regWages;

Ans: F




Assume this code fragment is embedded in an otherwise correct and complete program. What

should be the output from this code segment?

int main() {

for( int i = 0; i < 10; i++)

{

cout << "hello" << Lendl;

}

cout << i << endl;return 0; }

a. 10

b. 9

c. 0

d. The variable i is undefined in this scope, so this should not compile

Ans: d

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 Lectpearl. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 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
$13.99
  • (0)
  Add to cart