Exam 2: C++ Basics

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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

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

B

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

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

C

Which of the following is not a valid identifier?

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

A

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
(33)

Which of the following statements is NOT legal?

(Multiple Choice)
4.9/5
(32)

The integer 0 is considered true.

(True/False)
4.8/5
(28)

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.8/5
(33)

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
(33)

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

(Multiple Choice)
4.8/5
(29)

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.7/5
(41)

The body of a do-while loop always executes at least once.

(True/False)
4.9/5
(41)

Another way to write the value 3452211903 is

(Multiple Choice)
4.8/5
(42)

The stream that is used for output to the screen is called ___________.

(Short Answer)
4.8/5
(34)

The body of a while loop may never execute.

(True/False)
4.9/5
(30)

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

(Multiple Choice)
4.8/5
(30)

What is the output of the following code fragment? int x=0; while x < 5) cout << x << endl; x ++; cout << x << endl; a.0 b.5 c.4 d.unable to determine

(Short Answer)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(45)

Given the following code fragment and the input value of 2.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
(33)

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"; } a.x is zero b.x is not zero c.unable to determine d.x is 3

(Short Answer)
4.8/5
(32)

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.8/5
(43)
Showing 1 - 20 of 54
close modal

Filters

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