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. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
NULL
public
function prototype
preprocessor
2. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
#include directive
initialized
void
cmath
3. You can declare default values for a function in the ____________________.
unary scope resolution operator (::)
source file
function parameters
#include <headerfilename>
4. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
subscript (or index)
register
n
void
5. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
register
fixed
vectors
6. The ________ statement in a called function passes the value of an expression back to the calling function.
Counter-controlled or definite
object file
return
strcmp()
7. The ________ of an identifier is the portion of the program in which the identifier can be used.
public
cin >> variable
base class
scope
8. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call
preprocessor
base
cmath
ofstream
9. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
*
preprocessor
const
10. The ________ program combines the output of the compiler with various library functions to produce an executable image.
allocating memory
linker
member
identifiers
11. This manipulator causes the field to be left-justified with padding spaces printed to the right.
#include directive
like-type expression
left
strcpy()
12. A pointer is a variable that contains as its value the____________ of another variable.
semicolon
#include <headerfilename>
address
reserve words
13. You must have a ___________ for every variable you intend to use in a program
identifiers
definition
unary scope resolution operator (::)
new line
14. Sets floating-point values to a fixed decimal format
pointer
heap
fixed
opened
15. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
inheritance
semantics
this
switch
16. Function ________ is used to produce random numbers.
*
Semicolon
semicolon
rand
17. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
operator
function overloading
/n
Closing brace
18. An array that uses two subscripts is referred to as a(n) _________ array.
polymorphism
two-dimensional
register
#include <headerfilename>
19. The three values that can be used to initialize a pointer are 0 - __________ and an address.
NULL
globals
Arithmetic Operators
token
20. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
strlen()
binary operator
base
21. Used for function calls and local variables
const datatype identifier = value
stack
#include directive
new line
22. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
virtual functions
associations
auto
type coercion
23. The stream extraction operator
sorting
variables
arithmetic expression
>>
24. The idea that you can call the same function and the output will depend on the type of object you're using.
access specifier
strcpy()
polymorphism
% modulus
25. A filestream variable that represents the default output device
beginning
polymorphism
cout
Stack overflow
26. Initializers __________ must be used to initialize constant members of a class.
left
member
type coercion
semicolon
27. Keyword public is a(n) _________
virtual functions
register
access specifier
/n
28. The process of determining if an array contains a particular key value is called _________ the array.
stack
source file
Default memberwise assignment
searching
29. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
object-oriented analysis and design (OOAD)
editor
if...else
continue
30. A function that calls itself
Counter-controlled or definite
this
recursive function
variables
31. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
operator overloading
linker
friend
#include <headerfilename>
32. The sign you use for pointers
Stack overflow
globals
*
0
33. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
token
semantics
scope resolution operator
34. Every C++ statement ends with a(n) _________.
semicolon
delete
address
object file
35. A C++ statement that makes a decision is ______.
if
left
?
type casting (conversion)
36. Symbol that denotes an action to be performed
semicolon
operator
vectors
#include <headerfilename>
37. All C++ Variables are_________.
switch
strcpy()
case sensitive
polymorphism
38. data types that refer to numbers with decimals
floating-point
address
switch
&
39. A human readable file that contains C++ program
like-type expression
stack
source file
const
40. 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.
arithmetic expression
switch
template
void
41. This manipulator is used to establish a field width for the value immediately following it.
address
virtual functions
setw
pointer
42. The number used to refer to a particular element of an array is called its ________.
binary operator
subscript (or index)
before
mixed expression
43. A __________ should be used to declare the size of an array because it makes the program more scalable.
new line
endl (same as 'n')
syntax
constant variable
44. 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.
unary scope resolution operator (::)
scope resolution operator
<<
Sentinel
45. Header file that contains commonly performed mathematical functions
cmath
static_cast<char>(65)
static
source file
46. A memory location with a name and data type - its content may be changed during program execution
variable
const
binary operator
base
47. Grammar rules of the language; compiler will try to identify and locate syntax errors
char
comments
searching
syntax
48. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
selection
source file
Closing brace
before
49. The elements of an array are related by the fact that they have the same name and ___________.
rand
overloading
break
type
50. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
#include
cin >> variable
fstream
cmath