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 constant object must be __________; it cannot be modified after it is created.
special symbols
initialized
static_cast<char>(65)
base
2. 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.
char
subscript (or index)
continue
int values
3. A filestream variable that represents the default input source
globals
cin
token
named constant
4. Operator with two operands
binary operator
floating-point
searching
globals
5. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
Preprocessor
beginning
#include
continue
6. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
&
srand
globals
7. int namespace include using return examples of ___________
ofstream
reserve words
char
Preprocessor
8. A ________ program executes before the compiler's translation phase begins.
&
inheritance
preprocessor
assignment
9. Function ________ is used to set the random number seed to randomize a program.
mixed expression
const datatype identifier = value
Literals
srand
10. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
*
type
scope
11. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
getline
{ }
char
variable
12. Symbol that denotes an action to be performed
operator
local variable
Default memberwise assignment
Closing brace
13. The stream insertion operator
unary scope resolution operator (::)
setw
<<
unary operator
14. The ________ of an identifier is the portion of the program in which the identifier can be used.
return
scope
whitespace
floating-point
15. Header file that contains commonly performed mathematical functions
Stack overflow
cmath
fstream
ofstream
16. A variable declared outside any block or function is a ________ variable.
::
globals
function scope
global
17. 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.
unary operator
?
base
rand
18. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
linker
setw
return
non-static
19. A function is invoked with a ________.
data type
&
register
function call
20. Used to qualify hidden names so that they can be used.
Unified Modeling Language(UML)
<<
return
scope resolution operator
21. Sets floating-point values to a fixed decimal format
fixed
scope
::
type
22. Type casting syntax
<<
const datatype identifier = value
static_cast<char>(65)
strcmp()
23. The three values that can be used to initialize a pointer are 0 - __________ and an address.
like-type expression
#include <headerfilename>
NULL
static
24. A C++ statement that makes a decision is ______.
if
two-dimensional
token
#include directive
25. data types that refer to numbers with decimals
floating-point
dot (.)
<<
whitespace
26. Names of things that are used in a program - can apply to variables & constants and functions
template
classes
Default memberwise assignment
identifiers
27. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
editor
stack
friend
pointer
28. Program components in C++ are called functions and ________.
classes
associations
strlen()
function prototype
29. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
preprocessor
inline functions
comments
heap
30. A pointer is a variable that contains as its value the____________ of another variable.
unary operator
address
int values
new line
31. You can declare default values for a function in the ____________________.
function parameters
static
reserve words
Closing brace
32. This is used to mark the end of a complete C++ programming statement.
like-type expression
break
identifiers
Semicolon
33. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
new line
Arithmetic Operators
associations
subscript (or index)
34. This manipulator is used to establish a field width for the value immediately following it.
static
setw
preprocessor
#include <headerfilename>
35. The only integer that can be assigned directly to a pointer is_____________.
operator overloading
0
global
function parameters
36. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
function scope
void
assignment statement
*
37. The __________ operator reclaims memory previously allocated by new.
attributes
token
delete
&
38. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
n
semantics
ofstream
function prototype
39. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
data type
preprocessor
private
operator overloading
40. These are data items whose values do not change while the program is running
loader
identifiers
constant variable
Literals
41. A function that calls itself
function overloading
recursive function
getline
template
42. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
variable
Semicolon
editor
43. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
cin >> variable
syntax
stack
operator overloading
44. For every opening brace in a C++ program there must be a ______________.
derived class
template
Closing brace
const datatype identifier = value
45. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.
global
scope
/n
case sensitive
46. Two slash marks ( // ) indicate __________ of a comment
beginning
recursive
sorting
ofstream
47. Used for dynamically allocated variables
ofstream
?
reserved words
heap
48. The storage-class specifiers are mutable - auto - ________ - extern and static.
recursive
Preprocessor
n
register
49. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
Sentinel
selection
void
reserve words
50. The elements of an array are related by the fact that they have the same name and ___________.
type
static
whitespace
register