Exam 2: C++ Basics

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Given the following code fragment, what is the final value of y? Int x, y; X = -1; Y = 0; Whilex <= 3) { Y += 2; X += 1; }

Free
(Multiple Choice)
4.7/5
(32)
Correct Answer:
Verified

B

What is the value of x after the following statements? Int x; X = 15/4;

Free
(Multiple Choice)
4.8/5
(45)
Correct Answer:
Verified

B

Which of the following is a valid identifier?

Free
(Multiple Choice)
4.7/5
(36)
Correct Answer:
Verified

C

Given the following code fragment, which of the following expressions is always true? Int x; Cin >> x;

(Multiple Choice)
4.8/5
(38)

What is the value of x after the following statements? Int x; X = 0; X = x + 30;

(Multiple Choice)
4.8/5
(43)

What is the final value of x after the following fragment of code executes? Int x=0; Do { X++; }whilex > 0);

(Multiple Choice)
4.9/5
(34)

The body of a while loop may never execute.

(True/False)
4.9/5
(35)

Variable names may begin with a number.

(True/False)
4.7/5
(44)

The stream that is used for input from the keyboard is called ___________.

(Short Answer)
4.9/5
(39)

Which of the following statements is NOT legal?

(Multiple Choice)
4.8/5
(39)

The opposite of x >3 && x < 10) is x < 3 && x > 10)

(True/False)
4.8/5
(30)

What is the output of the following code? Cout << "This is a \\" << endl;

(Multiple Choice)
4.9/5
(44)

A loop that always executes the loop body at least once is known as a _____________ loop.

(Short Answer)
4.8/5
(34)

In a compound logical and &&) expression, the evaluation of the expression stops once one of the terms of the expression is false. This is known as ______________ evaluation.

(Short Answer)
4.9/5
(44)

What is the value of x after the following statements? Int x, y, z; Y = 10; Z = 3; X = y * z + 3;

(Multiple Choice)
4.8/5
(38)

Given the following code fragment, what is the output? Int x=5; If x > 5) Cout << "x is bigger than 5. "; Cout <<"That is all. "; Cout << "Goodbye\n";

(Multiple Choice)
4.9/5
(38)

Another way to write the value 3452211903 is

(Multiple Choice)
4.9/5
(35)

The _______ keyword in C++11 determines the type of a variable based on the data type that the variable is set to.

(Short Answer)
4.7/5
(42)

What is the advantage of the C++11 integer data types over the old data types?

(Multiple Choice)
4.8/5
(39)

When must we use braces to define the body of a contitional expression? ______________

(Essay)
4.9/5
(39)
Showing 1 - 20 of 57
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)