SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
C++ Programming Basics
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
whitespace
void
source file
2. The idea that you can call the same function and the output will depend on the type of object you're using.
comments
arithmetic expression
polymorphism
type casting (conversion)
3. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
Stack overflow
preprocessor
delete
>>
4. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call
endl (same as 'n')
base class
base
floating-point
5. Used to qualify hidden names so that they can be used.
Semicolon
ofstream
scope resolution operator
object-oriented analysis and design (OOAD)
6. The number used to refer to a particular element of an array is called its ________.
preprocessor
subscript (or index)
?
operand value
7. Operator with only one operand
base
operator overloading
unary operator
cin >> variable
8. Default name of executable file
fstream
Stack overflow
srand
a.out
9. A function that can be used to read character data including whitespace
cin.get(ch)
Arithmetic Operators
overloading
source file
10. __________ can be used to assign an object of a class to another object of the same class.
operator overloading
Default memberwise assignment
Stack overflow
type
11. The process of placing the elements of an array in order is called ________ the array.
escape sequences
sorting
cout
rand
12. The ________ qualifier is used to declare read-only variables.
const
&
cin >> variable
before
13. Sets floating-point values to a fixed decimal format
loader
source file
fixed
classes
14. All ______ must be declared before they are used.
/n
variables
Unified Modeling Language(UML)
ofstream
15. The ________ program combines the output of the compiler with various library functions to produce an executable image.
setw
linker
scope
NULL
16. Operator with two operands
% modulus
continue
binary operator
showpoint
17. Names of things that are used in a program - can apply to variables & constants and functions
if...else
identifiers
cin
showpoint
18. A pointer is a variable that contains as its value the____________ of another variable.
operand value
beginning
if
address
19. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
preprocessor
pointer
reserved words
void
20. Nonexecutable statements that are included in a program to provide information about what the program does etc.
inheritance
n
#include directive
comments
21. When a value of one data type is implicitly (automatically) changed to another data type
named constant
type coercion
preprocessor
information hiding
22. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
delete
global
local variable
const
23. The symbol for the binary scope resolution operator
0
::
two-dimensional
before
24. Used for dynamically allocated variables
object-oriented analysis and design (OOAD)
binary operator
heap
semantics
25. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.
static
>>
main
globals
26. A member function should be declared static if it does not access __________ class members.
data type
object file
non-static
public
27. These are data items whose values do not change while the program is running
#include <headerfilename>
Literals
default constructor
editor
28. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
if...else
const datatype identifier = value
srand
29. An operator that can only be used with int values. result will always be an int.
void
NULL
% modulus
cmath
30. Use 2 characters to represent one
private
cmath
reserved words
escape sequences
31. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
named constant
operand value
function scope
case sensitive
32. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
auto
default constructor
&
inheritance
33. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.
cmath
?
assignment statement
type coercion
34. Header file that contains commonly performed mathematical functions
if...else
cmath
heap
attributes
35. Words that are used for special purposes in a program
reserved words
local variable
Preprocessor
cmath
36. A filestream variable that represents the default output device
cout
subscript (or index)
friend
token
37. * / % + -
Arithmetic Operators
comments
function prototype
data type
38. The sign you use for pointers
switch
fstream
Literals
*
39. A variable declared outside any block or function is a ________ variable.
prompt
virtual functions
global
ofstream
40. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
unary operator
Counter-controlled or definite
data type
41. Most calculations are normally performed by ______ statements.
assignment
auto
token
#include directive
42. A C++ statement that makes a decision is ______.
this
if
mixed expression
object-oriented analysis and design (OOAD)
43. This is used to mark the end of a complete C++ programming statement.
n
constant variable
scope resolution operator
Semicolon
44. Function ________ is used to set the random number seed to randomize a program.
srand
searching
main
initialized
45. Lists and tables of values can be stored in arrays or __________.
Preprocessor
information hiding
prompt
vectors
46. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
floating-point
derived class
return
//
47. Creates a copy of a string.
strcpy()
setw
scope resolution operator
preprocessor
48. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
reserve words
globals
char
address
49. A function is invoked with a ________.
{ }
function call
classes
whitespace
50. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
reserve words
preprocessor
operator overloading
cmath