Exam 2: C++ Basics
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
What is the value of x after the following statements?
Int x;
X = 15/4;
Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
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:
C
Which of the following is not a valid identifier?
Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
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)
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 stream that is used for output to the screen is called ___________.
(Short Answer)
4.8/5
(34)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)