Exam 2: C++ Basics

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

What is the correct way to write the condition y < x < z?

(Multiple Choice)
4.8/5
(41)

Each time a loop body executes is known as an _______________________.

(Short Answer)
4.7/5
(42)

Given the following code fragment and the input value of 4.0, what output is generated? Float tax; Float total; Cout << "enter the cost of the item\n"; Cin >> total; If total >= 3.0) { Tax = 0.10; Cout << total + total * tax) << endl; } Else { Cout << total << endl; }

(Multiple Choice)
4.8/5
(45)

Executing one or more statements one or more times is known as:

(Multiple Choice)
4.9/5
(37)

In the following code fragment, x has the value of 3. int x = 3;

(True/False)
4.9/5
(36)

What is the output of the following code fragment? Int x=0; While x < 5) Cout << x << endl; X ++; Cout << x << endl;

(Multiple Choice)
4.9/5
(38)

What is the value of x after the following statement? Float x; X = 3.0 / 4.0 + 3 + 2 )/ 5

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(26)

What is the output of the following code? Float value; Value = 33.5; Cout << "value" << endl;

(Multiple Choice)
4.7/5
(41)

Every line in a program should have a comment.

(True/False)
4.9/5
(40)

What is the value of x after the following statements? Double x; X = 0; X += 3.0 * 4.0; X -= 2.0;

(Multiple Choice)
4.9/5
(44)

If x has the value of 3, y has the value of -2, and w is 10, is the following condition true or false? If x < 2 && w < y)

(Multiple Choice)
4.7/5
(42)

What is the opposite of x < 20 && x > 12)? _______________________

(Short Answer)
5.0/5
(42)

Given the following code fragment, and an input value of 5, what is the output? Int x; If x< 3) { Cout << "small\n"; } Else { If x < 4) { Cout << "medium\n"; } Else { If x < 6) { Cout << "large\n"; } Else { Cout << "giant\n"; } } }

(Multiple Choice)
4.9/5
(35)

if-else statements that are inside other if-else statements are said to be _______________.

(Short Answer)
4.7/5
(43)

Given the following code fragment, and an input value of 3, what is the output that is generated? Int x; Cout <<"Enter a value\n"; Cin >> x; Ifx=0) { Cout << "x is zero\n"; } Else { Cout << "x is not zero\n"; }

(Multiple Choice)
4.8/5
(36)

Which of the following is not a valid identifier?

(Multiple Choice)
4.9/5
(38)
Showing 41 - 57 of 57
close modal

Filters

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