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. A type of pointer that can point at objects of any data type.
stack
void pointer
>>
switch
2. In inheritance the ____________ is the class that supplies the inherited members.
base class
assignment statement
object-oriented analysis and design (OOAD)
auto
3. Every C++ statement ends with a(n) _________.
virtual functions
base class
semicolon
srand
4. An operator that can only be used with int values. result will always be an int.
scope
classes
searching
% modulus
5. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
if...else
virtual functions
base
assignment statement
6. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
switch
register
break
initialized
7. Characters used to separate symbols or reserved words or identifiers and statements
0
initialized
whitespace
void
8. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.
recursive
vectors
function call
dot (.)
9. The process of determining if an array contains a particular key value is called _________ the array.
return
searching
semicolon
floating-point
10. A function is invoked with a ________.
heap
function call
return
searching
11. Associate an identifier with a memory location
source file
inheritance
allocating memory
% modulus
12. A sequence of operands and operators that describe a calculation to be performed
template
const
arithmetic expression
floating-point
13. Function ________ is used to set the random number seed to randomize a program.
srand
semantics
two-dimensional
function overloading
14. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
data type
source file
function parameters
15. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
assignment statement
classes
token
recursive
16. directive A statement that starts with a # is called a ____________.
/n
cin.get(ch)
Preprocessor
//
17. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
strcmp()
friend
recursive function
Closing brace
18. An array that uses two subscripts is referred to as a(n) _________ array.
//
two-dimensional
public
token
19. Operator with two operands
local variable
binary operator
semicolon
whitespace
20. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
private
#include
variables
Preprocessor
21. A constant object must be __________; it cannot be modified after it is created.
address
initialized
assignment
//
22. Nonexecutable statements that are included in a program to provide information about what the program does etc.
operand value
semantics
comments
editor
23. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
type
local variable
function call
24. An expression in which all operands have the same data type - result will have the same data type as operands
object file
semantics
initialized
like-type expression
25. Creates a copy of a string.
const
variable
strcpy()
mixed expression
26. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
type coercion
named constant
cin >> variable
like-type expression
27. A variable that is known only within the function in which it is defined is called a ________.
Semicolon
opened
local variable
token
28. Default name of executable file
local variable
<<
allocating memory
a.out
29. This manipulator is used to establish a field width for the value immediately following it.
setw
&
scope
Unified Modeling Language(UML)
30. A function that can be used to read character data including whitespace
assignment
cin.get(ch)
searching
beginning
31. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
before
binary operator
cout
32. Keyword public is a(n) _________
access specifier
const
preprocessor
escape sequences
33. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
switch
if...else
object-oriented analysis and design (OOAD)
34. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
classes
function overloading
source file
endl (same as 'n')
35. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
friend
base class
semicolon
36. In inheritance the ____________ is the class the receives the inherited members.
cout
continue
a.out
derived class
37. This manipulator causes the field to be left-justified with padding spaces printed to the right.
function overloading
inline functions
left
static
38. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
cmath
this
named constant
access specifier
39. The symbol for the binary scope resolution operator
constant variable
#include <headerfilename>
::
Unified Modeling Language(UML)
40. A variable declared outside any block or function is a ________ variable.
base class
>>
dot (.)
global
41. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
cin
auto
/n
classes
42. Used for function calls and local variables
classes
information hiding
stack
searching
43. __________ can be used to assign an object of a class to another object of the same class.
virtual functions
token
Default memberwise assignment
searching
44. A pointer is a variable that contains as its value the____________ of another variable.
unary scope resolution operator (::)
//
address
Counter-controlled or definite
45. The idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
//
default constructor
*
46. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
//
like-type expression
semantics
mixed expression
47. This is used to mark the end of a complete C++ programming statement.
Semicolon
srand
delete
searching
48. Allows the programmer to store a value in a variable
Stack overflow
int values
assignment statement
NULL
49. Compares two strings and returns 0 if they are equal.
function prototype
showpoint
strcmp()
overloading
50. Returns the length of a string excluding the null terminator.
definition
break
Sentinel
strlen()