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. An array that uses two subscripts is referred to as a(n) _________ array.
overloading
two-dimensional
#include <headerfilename>
new line
2. Function ________ is used to set the random number seed to randomize a program.
unary operator
Arithmetic Operators
0
srand
3. In inheritance the ____________ is the class that supplies the inherited members.
two-dimensional
base class
named constant
cin >> variable
4. Initializers __________ must be used to initialize constant members of a class.
cin
member
ofstream
static
5. The elements of an array are related by the fact that they have the same name and ___________.
&
type
allocating memory
assignment statement
6. A sequence of operands and operators that describe a calculation to be performed
inheritance
arithmetic expression
global
new line
7. Executable version of program
object file
static
member
comments
8. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
0
a.out
void
public
9. 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.
.cpp
cmath
function overloading
inheritance
10. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
cin >> variable
endl (same as 'n')
reserve words
11. The ________ enables access to a global variable with the same name as a variable in the current scope.
Arithmetic Operators
unary scope resolution operator (::)
>>
#include
12. Two slash marks ( // ) indicate __________ of a comment
static
operator overloading
beginning
cmath
13. Class members specified as _________ are accessible anywhere an object of the class is in scope.
template
semicolon
loader
public
14. 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
two-dimensional
public
base
if...else
15. A variable that holds the address of another variable.
pointer
editor
vectors
inheritance
16. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
dot (.)
break
access specifier
preprocessor
17. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
function overloading
source file
this
18. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
searching
globals
whitespace
new line
19. Whole numbers - no decimals and no commas included
address
register
Unified Modeling Language(UML)
int values
20. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.
fixed
strlen()
initialized
Sentinel
21. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
unary operator
<<
friend
if
22. * / % + -
n
opened
Arithmetic Operators
stack
23. Used for dynamically allocated variables
virtual functions
heap
static
polymorphism
24. When a value of one data type is implicitly (automatically) changed to another data type
&
<<
char
type coercion
25. An expression in which all operands have the same data type - result will have the same data type as operands
this
reserve words
&
like-type expression
26. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
special symbols
Stack overflow
overloading
if...else
27. The modulus operator (%) can be used only with __________.
integer operands
{ }
type coercion
void
28. An operator that can only be used with int values. result will always be an int.
% modulus
if...else
classes
Default memberwise assignment
29. To write data to a file you define an object of which one of the following
>>
object file
ofstream
dot (.)
30. The ________ of an identifier is the portion of the program in which the identifier can be used.
static_cast<char>(65)
like-type expression
initialized
scope
31. A variable that is known only within the function in which it is defined is called a ________.
local variable
inheritance
friend
derived class
32. Names of things that are used in a program - can apply to variables & constants and functions
break
rand
identifiers
before
33. The only integer that can be assigned directly to a pointer is_____________.
assignment
% modulus
floating-point
0
34. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
inheritance
type casting (conversion)
endl (same as 'n')
new line
35. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
recursive function
a.out
inline functions
continue
36. The ________ qualifier is used to declare read-only variables.
const
*
cin
stack
37. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
floating-point
inline functions
polymorphism
function call
38. Identifier or expression that is part of the calculation to be performed
*
/n
cout
operand value
39. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
auto
?
function call
&
40. Use 2 characters to represent one
const
operator overloading
setw
escape sequences
41. data types that refer to numbers with decimals
preprocessor
#include directive
like-type expression
floating-point
42. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
assignment statement
function scope
left
const
43. 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.
preprocessor
static
overloading
type casting (conversion)
44. The symbol for the binary scope resolution operator
a.out
::
type casting (conversion)
ofstream
45. To explicitly indicate that a value is to be converted to another type
friend
type casting (conversion)
cin >> variable
left
46. Nonexecutable statements that are included in a program to provide information about what the program does etc.
{ }
comments
strcpy()
prompt
47. All C++ Variables are_________.
special symbols
globals
case sensitive
showpoint
48. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
overloading
non-static
prompt
#include
49. A member function should be declared static if it does not access __________ class members.
loader
subscript (or index)
non-static
endl (same as 'n')
50. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
stack
constant variable
private
getline