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.
#include <headerfilename>
#include
n
?
2. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
void
loader
const
operator overloading
3. The process of determining if an array contains a particular key value is called _________ the array.
unary operator
searching
void
% modulus
4. The storage-class specifiers are mutable - auto - ________ - extern and static.
inheritance
constant variable
% modulus
register
5. A filestream variable that represents the default output device
token
cout
inline functions
left
6. The address-of operator. it is used to assign pointers and to print the address of variables.
&
classes
void
source file
7. The ________ enables access to a global variable with the same name as a variable in the current scope.
auto
#include directive
classes
unary scope resolution operator (::)
8. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
type casting (conversion)
function prototype
break
new line
9. A memory location with a name and data type - its content may be changed during program execution
variable
return
cin.get(ch)
strlen()
10. Whole numbers - no decimals and no commas included
inline functions
two-dimensional
int values
integer operands
11. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
::
auto
new line
identifiers
12. int namespace include using return examples of ___________
//
reserve words
binary operator
return
13. The ________ program transfers the executable image of a C++ program from disk to memory.
inheritance
virtual functions
loader
const datatype identifier = value
14. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
const
Semicolon
void
15. Every C++ program begins execution at the function _________.
0
overloading
case sensitive
main
16. Preprocessor directive syntax
#include <headerfilename>
access specifier
showpoint
case sensitive
17. C++ programs are normally typed into a computer using a(n) ________ program.
int values
searching
arithmetic expression
editor
18. For every opening brace in a C++ program there must be a ______________.
Closing brace
private
selection
beginning
19. A C++ statement that makes a decision is ______.
if
scope
//
before
20. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
object-oriented analysis and design (OOAD)
main
function overloading
const
21. Initializers __________ must be used to initialize constant members of a class.
rand
void
member
NULL
22. Symbol that denotes an action to be performed
recursive function
if...else
scope
operator
23. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
Default memberwise assignment
searching
stack
24. Classes can have relationships with other classes. These relationships are called ________.
.cpp
reserved words
attributes
associations
25. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
t
if...else
constant variable
cin
26. tab
like-type expression
reserve words
whitespace
t
27. Repeating a set of instructions a specific number of times is called_________repetition.
variable
Counter-controlled or definite
this
&
28. Type casting syntax
Semicolon
pointer
overloading
static_cast<char>(65)
29. The _____ causes the contents of another file to be inserted into a program.
operator overloading
object file
#include directive
this
30. The sign you use for pointers
type coercion
*
0
object-oriented analysis and design (OOAD)
31. A __________ should be used to declare the size of an array because it makes the program more scalable.
operator overloading
base
constant variable
like-type expression
32. A variable that is known only within the function in which it is defined is called a ________.
local variable
integer operands
variables
prompt
33. 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.
ofstream
>>
continue
int values
34. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
template
pointer
static
cout
35. An expression in which all operands have the same data type - result will have the same data type as operands
source file
local variable
function call
like-type expression
36. 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.
recursive
base class
static
token
37. A file must be ________ before data can be written to or read from it.
return
cin
return
opened
38. Use 2 characters to represent one
scope resolution operator
preprocessor
escape sequences
loader
39. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
initialized
void
allocating memory
Closing brace
40. All ______ must be declared before they are used.
variables
Arithmetic Operators
base class
constant variable
41. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
delete
void
showpoint
42. Two slash marks ( // ) indicate __________ of a comment
assignment statement
beginning
private
virtual functions
43. 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.
derived class
inheritance
globals
function prototype
44. Function ________ is used to set the random number seed to randomize a program.
srand
static
showpoint
initialized
45. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
a.out
strcpy()
dot (.)
46. An expression that has operands with different data types
mixed expression
object file
NULL
operator overloading
47. To allow file access in a program you must #include this header file.
setw
cin
#include directive
fstream
48. These are data items whose values do not change while the program is running
Literals
setw
beginning
assignment
49. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
variables
mixed expression
base
50. Member objects are constructed __________ their enclosing class object.
virtual functions
before
scope resolution operator
special symbols