Exam 3: Expressions and Interactivity
Exam 1: Introduction to Computers and Programming44 Questions
Exam 2: Introduction to C++56 Questions
Exam 3: Expressions and Interactivity44 Questions
Exam 4: Making Decisions53 Questions
Exam 5: Loops and Files62 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays53 Questions
Exam 8: Searching and Sorting Arrays20 Questions
Exam 10: Characters, C++-Strings, and More About the String Class42 Questions
Exam 11: Structured Data43 Questions
Exam 11: Structured Data50 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes46 Questions
Exam 14: More About Classes40 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions38 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library STL39 Questions
Exam 17: Linked Lists40 Questions
Exam 18: Stacks and Queues46 Questions
Exam 19: Recursion21 Questions
Exam 20: Binary Trees38 Questions
Select questions type
Which line in the following program will cause a compiler error? 1 #include <iostream>
2 using namespace std;
3
4 int main()
5 {
6 const int MY_VAL;
7 MY_VAL = 77;
8 cout << MY_VAL << endl;
9 return 0;
10 }
Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
A
The function, pow(x, 5.0), requires this header file.
Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
B
You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?
Free
(Multiple Choice)
4.7/5
(39)
Correct Answer:
B
What is the value of average after the following code executes? double average;
Average = 1.0 + 2.0 + 3.0 / 3.0;
(Multiple Choice)
4.9/5
(39)
When using the sqrt function you must include this header file.
(Multiple Choice)
4.8/5
(30)
This manipulator is used to establish a field width for the value immediately following it.
(Multiple Choice)
4.7/5
(28)
You can use these to override the rules of operator precedence in a mathematical expression.
(Multiple Choice)
4.9/5
(42)
The statement cin >> setw(10) >> str;
Will read up to this many characters into str.
(Multiple Choice)
4.8/5
(34)
In any program that uses the cin object, you must include the ___________.
(Multiple Choice)
5.0/5
(41)
The fixed manipulator causes a number to be displayed in scientific notation.
(True/False)
4.8/5
(36)
This stream manipulator forces cout to print the digits in fixed-point notation.
(Multiple Choice)
4.8/5
(38)
When a program uses the setw manipulator, the iosetwidth header file must be included in a preprocessor directive.
(True/False)
4.9/5
(41)
When C++ is working with an operator, it strives to convert the operands to the same type.
(True/False)
4.7/5
(42)
The only difference between the get function and the >> operator is that get reads the first character typed, even if it is a space, tab, or the [Enter] key.
(True/False)
4.9/5
(38)
Assume that x is an int variable. What value is assigned to x after the following assignment statement is executed? x = -3 + 4 % 6 / 5;
(Multiple Choice)
4.9/5
(37)
The cin << statement will stop reading input when it encounters a newline character.
(True/False)
4.9/5
(38)
When this operator is used with string operands it concatenates them, or joins them together.
(Multiple Choice)
4.8/5
(33)
Which is true about the following statement? cout << setw(4) << num4 << " ";
(Multiple Choice)
5.0/5
(36)
In C++, it is impossible to display the number 34.789 in a field of 9 spaces with 2 decimal places of precision.
(True/False)
4.9/5
(36)
Showing 1 - 20 of 44
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)