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. Most calculations are normally performed by ______ statements.
assignment
dot (.)
arithmetic expression
#include
2. To write data to a file you define an object of which one of the following
left
.cpp
heap
ofstream
3. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include directive
srand
constant variable
#include
4. The symbol for the binary scope resolution operator
break
/n
auto
::
5. directive A statement that starts with a # is called a ____________.
static
Sentinel
sorting
Preprocessor
6. 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.
local variable
Sentinel
if
cmath
7. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.
Unified Modeling Language(UML)
dot (.)
identifiers
mixed expression
8. Sets floating-point values to a fixed decimal format
fixed
syntax
function overloading
cmath
9. 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.
non-static
reserve words
continue
classes
10. In inheritance the ____________ is the class that supplies the inherited members.
source file
base class
recursive
assignment
11. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
Closing brace
function scope
cmath
type casting (conversion)
12. This manipulator is used to establish a field width for the value immediately following it.
friend
setw
Counter-controlled or definite
subscript (or index)
13. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
vectors
function call
arithmetic expression
14. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
assignment statement
classes
variables
15. A filestream variable that represents the default output device
recursive function
semantics
NULL
cout
16. The __________ operator reclaims memory previously allocated by new.
named constant
delete
function prototype
operator
17. Two slash marks ( // ) indicate __________ of a comment
beginning
classes
assignment statement
{ }
18. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
case sensitive
delete
scope resolution operator
const
19. 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.
mixed expression
/n
non-static
operator overloading
20. This manipulator causes the field to be left-justified with padding spaces printed to the right.
Arithmetic Operators
definition
static_cast<char>(65)
left
21. An expression that has operands with different data types
<<
attributes
showpoint
mixed expression
22. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
type coercion
named constant
return
function overloading
23. A function that calls itself
template
recursive
arithmetic expression
recursive function
24. A C++ statement that makes a decision is ______.
object-oriented analysis and design (OOAD)
char
return
if
25. The process of placing the elements of an array in order is called ________ the array.
#include
sorting
global
function parameters
26. int namespace include using return examples of ___________
Preprocessor
fixed
linker
reserve words
27. Header file that contains commonly performed mathematical functions
floating-point
two-dimensional
arithmetic expression
cmath
28. Used to qualify hidden names so that they can be used.
like-type expression
recursive
Unified Modeling Language(UML)
scope resolution operator
29. A __________ data member represents class-wide information.
base
Preprocessor
cin
static
30. Use 2 characters to represent one
function scope
comments
integer operands
escape sequences
31. data types that refer to numbers with decimals
template
default constructor
floating-point
reserve words
32. A filestream variable that represents the default input source
delete
?
cin
member
33. The ________ program transfers the executable image of a C++ program from disk to memory.
loader
function call
beginning
case sensitive
34. Type casting syntax
static_cast<char>(65)
Counter-controlled or definite
setw
semantics
35. Function ________ is used to set the random number seed to randomize a program.
srand
new line
case sensitive
reserve words
36. Operator with two operands
Unified Modeling Language(UML)
before
pointer
binary operator
37. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
before
auto
static_cast<char>(65)
return
38. The sign you use for references
address
if
&
strcmp()
39. Compares two strings and returns 0 if they are equal.
Default memberwise assignment
strcmp()
variables
?
40. 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.
return
function parameters
?
#include
41. Names of things that are used in a program - can apply to variables & constants and functions
integer operands
identifiers
left
setw
42. A pointer is a variable that contains as its value the____________ of another variable.
#include directive
address
preprocessor
like-type expression
43. Used for function calls and local variables
static
strlen()
//
stack
44. The sign you use for pointers
polymorphism
this
*
base class
45. You must have a ___________ for every variable you intend to use in a program
definition
unary scope resolution operator (::)
<<
pointer
46. The ________ statement in a called function passes the value of an expression back to the calling function.
polymorphism
return
pointer
Stack overflow
47. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
derived class
<<
selection
48. The only integer that can be assigned directly to a pointer is_____________.
searching
classes
0
this
49. A constant object must be __________; it cannot be modified after it is created.
Default memberwise assignment
initialized
n
beginning
50. All C++ Variables are_________.
operator overloading
function call
cout
case sensitive