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 variable that is known only within the function in which it is defined is called a ________.
semicolon
register
local variable
source file
2. The process of analyzing and designing a system from an object-oriented point of view is called ________.
integer operands
object-oriented analysis and design (OOAD)
Arithmetic Operators
main
3. Default name of executable file
register
a.out
if...else
initialized
4. An expression that has operands with different data types
virtual functions
switch
mixed expression
token
5. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
linker
if...else
//
main
6. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
rand
static
function scope
.cpp
7. A C++ statement that makes a decision is ______.
ofstream
friend
if
showpoint
8. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
classes
default constructor
cin >> variable
information hiding
9. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
Unified Modeling Language(UML)
dot (.)
return
case sensitive
10. Allows the programmer to store a value in a variable
if...else
assignment statement
static_cast<char>(65)
void
11. A variable that holds the address of another variable.
local variable
Closing brace
assignment
pointer
12. In inheritance the ____________ is the class the receives the inherited members.
loader
dot (.)
operand value
derived class
13. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
#include
pointer
type
void
14. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
void
recursive
polymorphism
endl (same as 'n')
15. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
switch
cmath
prompt
16. For every opening brace in a C++ program there must be a ______________.
Closing brace
function parameters
stack
.cpp
17. Used to qualify hidden names so that they can be used.
NULL
scope resolution operator
static
arithmetic expression
18. A pointer is a variable that contains as its value the____________ of another variable.
address
base class
recursive function
int values
19. A file must be ________ before data can be written to or read from it.
cin >> variable
assignment statement
Closing brace
opened
20. All ______ must be declared before they are used.
Arithmetic Operators
cin >> variable
variables
searching
21. Every C++ program begins execution at the function _________.
delete
&
main
Unified Modeling Language(UML)
22. Most calculations are normally performed by ______ statements.
assignment
reserved words
/n
address
23. Repeating a set of instructions a specific number of times is called_________repetition.
Counter-controlled or definite
constant variable
definition
inheritance
24. The ________ statement in a called function passes the value of an expression back to the calling function.
const datatype identifier = value
t
return
pointer
25. A function that can be used to read character data including whitespace
cin.get(ch)
pointer
cout
fstream
26. The idea that you can call the same function and the output will depend on the type of object you're using.
Default memberwise assignment
polymorphism
strlen()
const
27. A human readable file that contains C++ program
unary scope resolution operator (::)
Arithmetic Operators
source file
rand
28. A filestream variable that represents the default input source
cin
type casting (conversion)
data type
if
29. A set of values together with a set of operations
<<
Preprocessor
return
data type
30. Program components in C++ are called functions and ________.
constant variable
member
classes
token
31. The symbol for the binary scope resolution operator
this
::
named constant
function prototype
32. Function ________ is used to produce random numbers.
variables
rand
function scope
Literals
33. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
fixed
&
virtual functions
34. 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.
preprocessor
dot (.)
two-dimensional
integer operands
35. = & | are examples of ____________.
register
::
special symbols
type coercion
36. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
cmath
register
function overloading
operand value
37. Grammar rules of the language; compiler will try to identify and locate syntax errors
cin.get(ch)
syntax
semicolon
function parameters
38. Classes can have relationships with other classes. These relationships are called ________.
a.out
return
Default memberwise assignment
associations
39. Syntax for named constant declaration
register
strlen()
if...else
const datatype identifier = value
40. The process of determining if an array contains a particular key value is called _________ the array.
named constant
searching
cin.get(ch)
classes
41. 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.
constant variable
?
stack
allocating memory
42. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
integer operands
Literals
ofstream
43. Header file that contains commonly performed mathematical functions
like-type expression
cmath
recursive
continue
44. A function that calls itself
binary operator
syntax
this
recursive function
45. * / % + -
special symbols
Arithmetic Operators
address
sorting
46. Two slash marks ( // ) indicate __________ of a comment
Arithmetic Operators
/n
beginning
prompt
47. To allow file access in a program you must #include this header file.
fstream
inline functions
% modulus
void pointer
48. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
Default memberwise assignment
setw
inline functions
return
49. Function ________ is used to set the random number seed to randomize a program.
srand
break
non-static
heap
50. A function is invoked with a ________.
preprocessor
void
Default memberwise assignment
function call