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 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.
/n
inheritance
*
return
2. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
loader
base class
virtual functions
private
3. A human readable file that contains C++ program
source file
function parameters
function call
semantics
4. A variable that is known only within the function in which it is defined is called a ________.
local variable
globals
setw
variables
5. A function that calls itself
const datatype identifier = value
Counter-controlled or definite
token
recursive function
6. This manipulator is used to establish a field width for the value immediately following it.
setw
this
reserve words
n
7. Initializers __________ must be used to initialize constant members of a class.
member
switch
inline functions
continue
8. For every opening brace in a C++ program there must be a ______________.
Closing brace
static
recursive function
Sentinel
9. Member objects are constructed __________ their enclosing class object.
Counter-controlled or definite
information hiding
before
source file
10. 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.
unary scope resolution operator (::)
continue
editor
operand value
11. An array that uses two subscripts is referred to as a(n) _________ array.
static_cast<char>(65)
cin.get(ch)
two-dimensional
case sensitive
12. Sets floating-point values to a fixed decimal format
template
static_cast<char>(65)
break
fixed
13. The process of placing the elements of an array in order is called ________ the array.
mixed expression
friend
object-oriented analysis and design (OOAD)
sorting
14. Symbol that denotes an action to be performed
data type
arithmetic expression
operator
identifiers
15. A filestream variable that represents the default output device
cout
::
preprocessor
&
16. Every C++ program begins execution at the function _________.
derived class
main
if...else
member
17. In inheritance the ____________ is the class that supplies the inherited members.
static
return
endl (same as 'n')
base class
18. Class members specified as _________ are accessible anywhere an object of the class is in scope.
switch
public
special symbols
getline
19. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
operator
function prototype
inline functions
showpoint
20. To allow file access in a program you must #include this header file.
getline
char
fstream
escape sequences
21. The modulus operator (%) can be used only with __________.
Literals
integer operands
continue
return
22. The ________ statement in a called function passes the value of an expression back to the calling function.
Preprocessor
new line
strcpy()
return
23. Two slash marks ( // ) indicate __________ of a comment
information hiding
beginning
recursive function
Preprocessor
24. Operator with two operands
binary operator
public
allocating memory
token
25. The idea that you can call the same function and the output will depend on the type of object you're using.
0
polymorphism
opened
classes
26. The ________ enables access to a global variable with the same name as a variable in the current scope.
<<
unary scope resolution operator (::)
register
strcmp()
27. A variable that holds the address of another variable.
if
type coercion
if...else
pointer
28. Allows the programmer to store a value in a variable
default constructor
subscript (or index)
assignment statement
if
29. A __________ data member represents class-wide information.
function overloading
static
getline
special symbols
30. 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.
Sentinel
heap
function prototype
int values
31. All C++ Variables are_________.
case sensitive
binary operator
delete
non-static
32. Most calculations are normally performed by ______ statements.
linker
assignment
token
strcpy()
33. The stream insertion operator
scope resolution operator
preprocessor
<<
//
34. A set of values together with a set of operations
data type
void
unary scope resolution operator (::)
stack
35. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
derived class
Closing brace
cin >> variable
comments
36. Identifier or expression that is part of the calculation to be performed
?
operand value
preprocessor
fixed
37. Header file that contains commonly performed mathematical functions
member
fstream
cmath
classes
38. The size & shape & color and weight of an object are considered
this
endl (same as 'n')
attributes
semicolon
39. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
allocating memory
assignment
semantics
classes
40. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
sorting
return
subscript (or index)
#include <headerfilename>
41. An expression that has operands with different data types
Default memberwise assignment
mixed expression
virtual functions
if
42. All ______ must be declared before they are used.
new line
Arithmetic Operators
variables
register
43. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
&
strlen()
pointer
dot (.)
44. Default name of executable file
a.out
Sentinel
variable
named constant
45. To write data to a file you define an object of which one of the following
ofstream
type
unary scope resolution operator (::)
function call
46. Every C++ statement ends with a(n) _________.
#include <headerfilename>
semicolon
return
vectors
47. The address-of operator. it is used to assign pointers and to print the address of variables.
#include directive
&
fixed
semicolon
48. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
constant variable
if
function parameters
recursive
49. A file must be ________ before data can be written to or read from it.
new line
opened
Preprocessor
&
50. A function that can be used to read character data including whitespace
Default memberwise assignment
base
cin.get(ch)
subscript (or index)