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. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
pointer
setw
char
subscript (or index)
2. A __________ data member represents class-wide information.
access specifier
cin.get(ch)
static
Arithmetic Operators
3. The elements of an array are related by the fact that they have the same name and ___________.
rand
type
classes
Arithmetic Operators
4. Used for function calls and local variables
named constant
stack
globals
const
5. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
type casting (conversion)
ofstream
break
overloading
6. tab
endl (same as 'n')
classes
escape sequences
t
7. The number used to refer to a particular element of an array is called its ________.
semantics
NULL
subscript (or index)
Closing brace
8. A function that can be used to read character data including whitespace
setw
cin.get(ch)
preprocessor
identifiers
9. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
left
new line
&
Stack overflow
10. A constant object must be __________; it cannot be modified after it is created.
/n
?
initialized
break
11. An array that uses two subscripts is referred to as a(n) _________ array.
return
preprocessor
two-dimensional
Unified Modeling Language(UML)
12. Classes can have relationships with other classes. These relationships are called ________.
classes
Semicolon
associations
loader
13. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
inline functions
operator
address
#include
14. You must have a ___________ for every variable you intend to use in a program
t
definition
operator
reserve words
15. A function ________ enables a single function to be defined to perform a task on many different data types.
operator
srand
pointer
template
16. This manipulator causes the field to be left-justified with padding spaces printed to the right.
cmath
left
Semicolon
scope
17. An expression in which all operands have the same data type - result will have the same data type as operands
n
comments
like-type expression
cin
18. The __________ operator reclaims memory previously allocated by new.
pointer
#include <headerfilename>
delete
like-type expression
19. A human readable file that contains C++ program
source file
::
rand
if...else
20. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
>>
heap
const datatype identifier = value
pointer
21. Naming convention for C++ programs
dot (.)
.cpp
classes
NULL
22. The _________ begins the body of every function and the _________ ends the body of every function.
binary operator
::
showpoint
{ }
23. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
comments
Preprocessor
type casting (conversion)
24. Use 2 characters to represent one
local variable
rand
NULL
escape sequences
25. data types that refer to numbers with decimals
preprocessor
scope
floating-point
polymorphism
26. A C++ statement that makes a decision is ______.
getline
local variable
cin.get(ch)
if
27. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
public
switch
function prototype
fixed
28. 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.
inheritance
const
&
char
29. Preprocessor directive syntax
0
srand
#include <headerfilename>
whitespace
30. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
sorting
#include directive
ofstream
31. A __________ should be used to declare the size of an array because it makes the program more scalable.
inheritance
cin >> variable
constant variable
reserved words
32. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
linker
scope resolution operator
searching
Unified Modeling Language(UML)
33. Function ________ is used to produce random numbers.
rand
syntax
object file
local variable
34. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
allocating memory
assignment statement
base
auto
35. Creates a copy of a string.
default constructor
strcpy()
token
virtual functions
36. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
heap
>>
return
two-dimensional
37. A function that calls itself
recursive function
static
if...else
virtual functions
38. directive A statement that starts with a # is called a ____________.
semicolon
Preprocessor
definition
initialized
39. The only integer that can be assigned directly to a pointer is_____________.
0
?
this
t
40. 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.
return
Sentinel
semicolon
object file
41. For every opening brace in a C++ program there must be a ______________.
&
Closing brace
fstream
local variable
42. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
virtual functions
stack
&
char
43. A set of values together with a set of operations
access specifier
data type
prompt
continue
44. Most calculations are normally performed by ______ statements.
Arithmetic Operators
constant variable
base
assignment
45. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
fstream
inline functions
return
0
46. The ________ of an identifier is the portion of the program in which the identifier can be used.
virtual functions
floating-point
scope
&
47. A variable declared outside any block or function is a ________ variable.
object-oriented analysis and design (OOAD)
type
register
global
48. A type of pointer that can point at objects of any data type.
semicolon
void pointer
&
assignment statement
49. In inheritance the ____________ is the class the receives the inherited members.
void pointer
derived class
preprocessor
vectors
50. If a member initializer is not provided for a member object of a class the object's __________ is called.
new line
t
cout
default constructor