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. Member objects are constructed __________ their enclosing class object.
function scope
before
floating-point
Stack overflow
2. The ________ enables access to a global variable with the same name as a variable in the current scope.
template
ofstream
auto
unary scope resolution operator (::)
3. Lists and tables of values can be stored in arrays or __________.
assignment statement
whitespace
endl (same as 'n')
vectors
4. To allow file access in a program you must #include this header file.
object-oriented analysis and design (OOAD)
information hiding
fstream
% modulus
5. An operator that can only be used with int values. result will always be an int.
% modulus
virtual functions
>>
fstream
6. A __________ should be used to declare the size of an array because it makes the program more scalable.
type
constant variable
unary scope resolution operator (::)
sorting
7. A function that calls itself
recursive function
attributes
fixed
/n
8. For every opening brace in a C++ program there must be a ______________.
Closing brace
ofstream
const datatype identifier = value
escape sequences
9. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
function call
scope
operator overloading
register
10. Two slash marks ( // ) indicate __________ of a comment
?
&
main
beginning
11. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
assignment statement
associations
unary scope resolution operator (::)
if...else
12. Nonexecutable statements that are included in a program to provide information about what the program does etc.
prompt
comments
#include directive
left
13. This manipulator is used to establish a field width for the value immediately following it.
*
setw
function overloading
binary operator
14. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
auto
token
whitespace
searching
15. A member function should be declared static if it does not access __________ class members.
two-dimensional
non-static
operand value
object file
16. Syntax for named constant declaration
const
overloading
const datatype identifier = value
{ }
17. The symbol for the binary scope resolution operator
::
linker
cin.get(ch)
return
18. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
Counter-controlled or definite
Unified Modeling Language(UML)
Sentinel
inline functions
19. int namespace include using return examples of ___________
constant variable
cout
object-oriented analysis and design (OOAD)
reserve words
20. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
loader
#include
information hiding
inline functions
21. = & | are examples of ____________.
special symbols
mixed expression
n
classes
22. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
non-static
selection
showpoint
auto
23. Associate an identifier with a memory location
endl (same as 'n')
semantics
allocating memory
inheritance
24. The elements of an array are related by the fact that they have the same name and ___________.
integer operands
type
base class
editor
25. 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.
Default memberwise assignment
Sentinel
% modulus
friend
26. The process of placing the elements of an array in order is called ________ the array.
const datatype identifier = value
operand value
prompt
sorting
27. C++ programs are normally typed into a computer using a(n) ________ program.
int values
editor
opened
associations
28. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
static
data type
operator overloading
int values
29. Returns the length of a string excluding the null terminator.
#include directive
strlen()
rand
srand
30. The stream insertion operator
member
if
sorting
<<
31. Compares two strings and returns 0 if they are equal.
strcmp()
continue
t
opened
32. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
showpoint
void
operand value
variables
33. A type of pointer that can point at objects of any data type.
fixed
const
% modulus
void pointer
34. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
source file
return
const
initialized
35. Every C++ program begins execution at the function _________.
main
.cpp
&
const
36. In inheritance the ____________ is the class that supplies the inherited members.
Stack overflow
function call
base class
&
37. directive A statement that starts with a # is called a ____________.
variables
Preprocessor
definition
vectors
38. __________ can be used to assign an object of a class to another object of the same class.
delete
function scope
globals
Default memberwise assignment
39. Initializers __________ must be used to initialize constant members of a class.
member
if...else
Semicolon
mixed expression
40. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
template
return
void
41. Symbol that denotes an action to be performed
member
editor
operator
global
42. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
rand
integer operands
reserve words
43. Header file that contains commonly performed mathematical functions
auto
Arithmetic Operators
cmath
rand
44. Words that are used for special purposes in a program
vectors
base class
attributes
reserved words
45. Classes can have relationships with other classes. These relationships are called ________.
function scope
vectors
type coercion
associations
46. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
47. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
variable
break
&
operator overloading
48. Function ________ is used to produce random numbers.
assignment
void
rand
void pointer
49. A file must be ________ before data can be written to or read from it.
fstream
like-type expression
function scope
opened
50. Allows the programmer to store a value in a variable
inline functions
assignment statement
Default memberwise assignment
static