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. 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.
t
polymorphism
static
return
2. If a member initializer is not provided for a member object of a class the object's __________ is called.
&
default constructor
searching
preprocessor
3. 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
t
template
base
recursive function
4. For every opening brace in a C++ program there must be a ______________.
address
return
Closing brace
editor
5. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
static_cast<char>(65)
fixed
pointer
return
6. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
globals
void
function scope
function parameters
7. Operator with only one operand
scope
dot (.)
recursive
unary operator
8. A ________ program executes before the compiler's translation phase begins.
member
*
derived class
preprocessor
9. Compares two strings and returns 0 if they are equal.
a.out
virtual functions
strcmp()
0
10. A constant object must be __________; it cannot be modified after it is created.
syntax
a.out
friend
initialized
11. Lists and tables of values can be stored in arrays or __________.
vectors
reserved words
showpoint
opened
12. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
function overloading
operator
template
globals
13. This manipulator causes the field to be left-justified with padding spaces printed to the right.
&
function parameters
access specifier
left
14. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
template
integer operands
break
sorting
15. The process of placing the elements of an array in order is called ________ the array.
&
0
beginning
sorting
16. Forces the computer to display decimal point and trailing zeroes
Sentinel
fixed
?
showpoint
17. The stream extraction operator
operator overloading
>>
srand
private
18. A memory location with a name and data type - its content may be changed during program execution
static_cast<char>(65)
before
variable
operator overloading
19. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
variable
attributes
static_cast<char>(65)
private
20. C++ programs are normally typed into a computer using a(n) ________ program.
editor
scope
floating-point
dot (.)
21. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
this
attributes
scope resolution operator
Default memberwise assignment
22. Preprocessor directive syntax
Default memberwise assignment
#include <headerfilename>
inline functions
opened
23. Member objects are constructed __________ their enclosing class object.
global
cin.get(ch)
before
t
24. A variable that is known only within the function in which it is defined is called a ________.
recursive function
local variable
selection
function parameters
25. A C++ statement that makes a decision is ______.
initialized
if
mixed expression
scope resolution operator
26. = & | are examples of ____________.
variable
special symbols
getline
operand value
27. All C++ Variables are_________.
semicolon
default constructor
function scope
case sensitive
28. A function is invoked with a ________.
pointer
function call
prompt
const
29. Sets floating-point values to a fixed decimal format
a.out
fixed
vectors
/n
30. The ________ enables access to a global variable with the same name as a variable in the current scope.
two-dimensional
attributes
semicolon
unary scope resolution operator (::)
31. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
0
public
cin >> variable
#include
32. A pointer is a variable that contains as its value the____________ of another variable.
cmath
classes
unary operator
address
33. The sign you use for pointers
preprocessor
>>
fstream
*
34. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
dot (.)
char
public
private
35. __________ can be used to assign an object of a class to another object of the same class.
if...else
unary operator
Default memberwise assignment
virtual functions
36. Used to qualify hidden names so that they can be used.
initialized
scope resolution operator
unary operator
dot (.)
37. The ________ statement in a called function passes the value of an expression back to the calling function.
recursive
object file
return
operand value
38. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.
preprocessor
{ }
subscript (or index)
information hiding
39. The number used to refer to a particular element of an array is called its ________.
source file
subscript (or index)
const
floating-point
40. A __________ data member represents class-wide information.
static
return
heap
cin.get(ch)
41. You must have a ___________ for every variable you intend to use in a program
definition
const
strcmp()
whitespace
42. An operator that can only be used with int values. result will always be an int.
opened
?
% modulus
Preprocessor
43. Words that are used for special purposes in a program
reserved words
classes
pointer
overloading
44. A function that can be used to read character data including whitespace
cin.get(ch)
% modulus
mixed expression
rand
45. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
prompt
cin.get(ch)
register
static
46. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
sorting
>>
void
semantics
47. A set of values together with a set of operations
reserved words
loader
data type
assignment statement
48. Class members specified as _________ are accessible anywhere an object of the class is in scope.
>>
public
selection
rand
49. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
escape sequences
integer operands
operator overloading
Arithmetic Operators
50. A variable declared outside any block or function is a ________ variable.
setw
arithmetic expression
global
before