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 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
polymorphism
?
stack
2. newline
::
register
n
assignment statement
3. The _____ causes the contents of another file to be inserted into a program.
*
#include directive
dot (.)
return
4. An expression that has operands with different data types
allocating memory
dot (.)
member
mixed expression
5. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
recursive function
const
?
before
6. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
stack
auto
escape sequences
function scope
7. Function ________ is used to produce random numbers.
continue
rand
Closing brace
recursive function
8. This manipulator causes the field to be left-justified with padding spaces printed to the right.
void
static
cin >> variable
left
9. Words that are used for special purposes in a program
const
reserved words
globals
address
10. A type of pointer that can point at objects of any data type.
function scope
template
main
void pointer
11. An operator that can only be used with int values. result will always be an int.
prompt
allocating memory
% modulus
floating-point
12. The idea that you can call the same function and the output will depend on the type of object you're using.
public
return
const datatype identifier = value
polymorphism
13. A function ________ enables a single function to be defined to perform a task on many different data types.
::
template
setw
case sensitive
14. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
delete
integer operands
break
15. Compares two strings and returns 0 if they are equal.
strcmp()
non-static
NULL
type
16. Use 2 characters to represent one
like-type expression
recursive function
escape sequences
subscript (or index)
17. Operator with only one operand
unary operator
operand value
return
like-type expression
18. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
delete
beginning
classes
19. Sets floating-point values to a fixed decimal format
information hiding
Unified Modeling Language(UML)
fixed
#include directive
20. A human readable file that contains C++ program
scope
NULL
source file
local variable
21. These are data items whose values do not change while the program is running
Literals
classes
function parameters
loader
22. If a member initializer is not provided for a member object of a class the object's __________ is called.
virtual functions
.cpp
n
default constructor
23. A C++ statement that makes a decision is ______.
if...else
if
0
main
24. The process of placing the elements of an array in order is called ________ the array.
function scope
sorting
inline functions
a.out
25. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
public
preprocessor
pointer
recursive
26. All C++ Variables are_________.
&
setw
template
case sensitive
27. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
case sensitive
pointer
register
unary scope resolution operator (::)
28. 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.
endl (same as 'n')
cin >> variable
#include <headerfilename>
dot (.)
29. 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.
sorting
const
source file
Sentinel
30. Nonexecutable statements that are included in a program to provide information about what the program does etc.
comments
endl (same as 'n')
new line
>>
31. An array that uses two subscripts is referred to as a(n) _________ array.
#include directive
two-dimensional
classes
selection
32. The address-of operator. it is used to assign pointers and to print the address of variables.
preprocessor
&
base class
register
33. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
unary operator
Literals
int values
34. data types that refer to numbers with decimals
heap
named constant
subscript (or index)
floating-point
35. Associate an identifier with a memory location
allocating memory
static
reserve words
int values
36. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
default constructor
cin >> variable
getline
base
37. The sign you use for references
subscript (or index)
void
&
definition
38. The symbol for the binary scope resolution operator
::
strlen()
*
a.out
39. Identifier or expression that is part of the calculation to be performed
operator overloading
operand value
selection
type
40. Syntax for named constant declaration
operator overloading
token
const datatype identifier = value
fixed
41. 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.
stack
Literals
static
constant variable
42. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
n
searching
this
data type
43. The __________ operator reclaims memory previously allocated by new.
constant variable
showpoint
friend
delete
44. Returns the length of a string excluding the null terminator.
Sentinel
*
strlen()
type casting (conversion)
45. A filestream variable that represents the default input source
ofstream
cin
::
like-type expression
46. A function is invoked with a ________.
function overloading
function call
operand value
unary operator
47. The stream extraction operator
this
>>
case sensitive
if
48. The ________ of an identifier is the portion of the program in which the identifier can be used.
{ }
source file
object-oriented analysis and design (OOAD)
scope
49. The ________ qualifier is used to declare read-only variables.
const
strcpy()
unary operator
access specifier
50. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
#include directive
cmath
allocating memory