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. The storage-class specifiers are mutable - auto - ________ - extern and static.
register
0
auto
classes
2. Operator with two operands
binary operator
return
strcpy()
.cpp
3. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
strcmp()
local variable
inline functions
0
4. Associate an identifier with a memory location
data type
default constructor
allocating memory
Preprocessor
5. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
recursive function
public
&
6. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
preprocessor
unary operator
operator overloading
?
7. To explicitly indicate that a value is to be converted to another type
subscript (or index)
const
public
type casting (conversion)
8. A filestream variable that represents the default input source
virtual functions
strlen()
n
cin
9. For every opening brace in a C++ program there must be a ______________.
static
Closing brace
Counter-controlled or definite
strlen()
10. To allow file access in a program you must #include this header file.
fstream
const
virtual functions
base class
11. This manipulator causes the field to be left-justified with padding spaces printed to the right.
0
left
definition
pointer
12. A human readable file that contains C++ program
selection
whitespace
rand
source file
13. To write data to a file you define an object of which one of the following
cin
fstream
ofstream
Counter-controlled or definite
14. The __________ operator reclaims memory previously allocated by new.
delete
base class
initialized
template
15. A type of pointer that can point at objects of any data type.
cin
void pointer
default constructor
const datatype identifier = value
16. Grammar rules of the language; compiler will try to identify and locate syntax errors
return
scope
syntax
::
17. 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.
% modulus
const
Sentinel
setw
18. The sign you use for references
switch
like-type expression
&
vectors
19. Classes can have relationships with other classes. These relationships are called ________.
rand
whitespace
associations
searching
20. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
reserve words
semantics
0
switch
21. Identifier or expression that is part of the calculation to be performed
0
operand value
virtual functions
>>
22. A ________ program executes before the compiler's translation phase begins.
setw
linker
preprocessor
pointer
23. Function ________ is used to set the random number seed to randomize a program.
srand
static
public
function overloading
24. Every C++ statement ends with a(n) _________.
getline
semicolon
::
static_cast<char>(65)
25. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
return
mixed expression
rand
#include directive
26. A C++ statement that makes a decision is ______.
if
char
cin.get(ch)
left
27. A function ________ enables a single function to be defined to perform a task on many different data types.
template
endl (same as 'n')
subscript (or index)
assignment
28. A set of values together with a set of operations
Counter-controlled or definite
reserve words
data type
non-static
29. You can declare default values for a function in the ____________________.
recursive
allocating memory
function parameters
register
30. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
opened
constant variable
base class
31. The symbol for the binary scope resolution operator
sorting
#include <headerfilename>
/n
::
32. Whole numbers - no decimals and no commas included
access specifier
int values
0
Semicolon
33. The idea that you can call the same function and the output will depend on the type of object you're using.
address
case sensitive
arithmetic expression
polymorphism
34. 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
strcmp()
identifiers
data type
35. directive A statement that starts with a # is called a ____________.
Preprocessor
left
dot (.)
loader
36. A __________ data member represents class-wide information.
Arithmetic Operators
static
access specifier
preprocessor
37. These are data items whose values do not change while the program is running
binary operator
t
polymorphism
Literals
38. 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.
loader
0
pointer
dot (.)
39. Allows the programmer to store a value in a variable
strcpy()
assignment statement
auto
semantics
40. The ________ statement in a called function passes the value of an expression back to the calling function.
named constant
continue
return
template
41. Characters used to separate symbols or reserved words or identifiers and statements
endl (same as 'n')
token
whitespace
template
42. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
opened
heap
this
a.out
43. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
void
escape sequences
static
switch
44. int namespace include using return examples of ___________
const
left
cmath
reserve words
45. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
#include directive
const
strcpy()
getline
46. The stream insertion operator
vectors
<<
cin >> variable
base class
47. This is used to mark the end of a complete C++ programming statement.
const
scope
private
Semicolon
48. A function that can be used to read character data including whitespace
object-oriented analysis and design (OOAD)
cin.get(ch)
cmath
::
49. A program that finds and attaches to your program the indicated libraries for compilation
n
preprocessor
return
register
50. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
syntax
inheritance
//
<<