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. Used for dynamically allocated variables
attributes
heap
allocating memory
object file
2. An operator that can only be used with int values. result will always be an int.
% modulus
void
NULL
/n
3. A sequence of operands and operators that describe a calculation to be performed
rand
linker
register
arithmetic expression
4. newline
n
static
setw
function parameters
5. Operator with only one operand
if
unary operator
const
default constructor
6. A function ________ enables a single function to be defined to perform a task on many different data types.
token
template
type casting (conversion)
whitespace
7. Member objects are constructed __________ their enclosing class object.
fixed
static_cast<char>(65)
before
new line
8. Whole numbers - no decimals and no commas included
static
cin
inline functions
int values
9. You must have a ___________ for every variable you intend to use in a program
Sentinel
setw
definition
member
10. A member function should be declared static if it does not access __________ class members.
void pointer
non-static
recursive function
/n
11. The ________ program transfers the executable image of a C++ program from disk to memory.
left
operand value
loader
two-dimensional
12. tab
assignment
*
allocating memory
t
13. The __________ operator reclaims memory previously allocated by new.
Arithmetic Operators
overloading
::
delete
14. 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.
this
virtual functions
reserved words
break
15. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
&
function scope
subscript (or index)
srand
16. The idea that you can call the same function and the output will depend on the type of object you're using.
object file
classes
two-dimensional
polymorphism
17. The three values that can be used to initialize a pointer are 0 - __________ and an address.
token
integer operands
static
NULL
18. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
scope
fixed
Arithmetic Operators
19. This is used to mark the end of a complete C++ programming statement.
Unified Modeling Language(UML)
like-type expression
Semicolon
unary operator
20. Associate an identifier with a memory location
char
allocating memory
escape sequences
strcmp()
21. 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.
break
?
NULL
source file
22. Nonexecutable statements that are included in a program to provide information about what the program does etc.
comments
overloading
named constant
pointer
23. When a value of one data type is implicitly (automatically) changed to another data type
derived class
definition
type coercion
searching
24. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
global
non-static
% modulus
25. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
Stack overflow
token
constant variable
26. Message displayed to the screen asking user for input; generated with an output statement
fixed
prompt
const datatype identifier = value
initialized
27. Function ________ is used to produce random numbers.
arithmetic expression
operand value
rand
object-oriented analysis and design (OOAD)
28. The symbol for the binary scope resolution operator
stack
cin
::
setw
29. The ________ enables access to a global variable with the same name as a variable in the current scope.
global
unary scope resolution operator (::)
local variable
preprocessor
30. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
associations
>>
Preprocessor
char
31. C++ programs are normally typed into a computer using a(n) ________ program.
*
Arithmetic Operators
strcpy()
editor
32. * / % + -
Arithmetic Operators
<<
pointer
binary operator
33. A memory location with a name and data type - its content may be changed during program execution
0
variable
object file
% modulus
34. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
function scope
Stack overflow
beginning
35. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
selection
left
pointer
variable
36. The storage-class specifiers are mutable - auto - ________ - extern and static.
editor
register
semantics
member
37. A type of pointer that can point at objects of any data type.
base class
void pointer
left
inline functions
38. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
if
return
strcmp()
before
39. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
object-oriented analysis and design (OOAD)
void
token
base
40. __________ can be used to assign an object of a class to another object of the same class.
setw
this
Default memberwise assignment
% modulus
41. Returns the length of a string excluding the null terminator.
Arithmetic Operators
operator
strlen()
private
42. 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.
Default memberwise assignment
constant variable
continue
cin.get(ch)
43. Program components in C++ are called functions and ________.
classes
whitespace
<<
function call
44. 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
local variable
setw
arithmetic expression
45. 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.
delete
Sentinel
Arithmetic Operators
type coercion
46. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
&
friend
member
attributes
47. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
default constructor
function parameters
% modulus
getline
48. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
recursive function
void
.cpp
if...else
49. Characters used to separate symbols or reserved words or identifiers and statements
endl (same as 'n')
% modulus
whitespace
void
50. These are data items whose values do not change while the program is running
classes
Literals
srand
Closing brace