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 ________.
local variable
static
type casting (conversion)
operator
2. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
void
vectors
template
return
3. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
const
subscript (or index)
prompt
4. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
overloading
fixed
private
function call
5. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.
Default memberwise assignment
static
scope
classes
6. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
0
//
void
recursive
7. When a value of one data type is implicitly (automatically) changed to another data type
strlen()
stack
auto
type coercion
8. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
variables
char
constant variable
floating-point
9. The ________ program transfers the executable image of a C++ program from disk to memory.
type
new line
virtual functions
loader
10. The storage-class specifiers are mutable - auto - ________ - extern and static.
information hiding
fixed
variable
register
11. Member objects are constructed __________ their enclosing class object.
data type
setw
function overloading
before
12. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
Closing brace
char
static
pointer
13. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.
void pointer
operator
information hiding
delete
14. 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.
dot (.)
data type
delete
searching
15. A type of pointer that can point at objects of any data type.
scope
::
dot (.)
void pointer
16. Grammar rules of the language; compiler will try to identify and locate syntax errors
delete
syntax
int values
ofstream
17. The elements of an array are related by the fact that they have the same name and ___________.
fstream
constant variable
.cpp
type
18. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
global
information hiding
#include
19. To write data to a file you define an object of which one of the following
ofstream
cin >> variable
semantics
cin
20. 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.
special symbols
/n
variables
const
21. The ________ statement in a called function passes the value of an expression back to the calling function.
semantics
return
showpoint
#include
22. 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
srand
base
delete
selection
23. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
static
special symbols
semantics
function overloading
24. The symbol for the binary scope resolution operator
preprocessor
<<
::
srand
25. The _____ causes the contents of another file to be inserted into a program.
new line
0
#include directive
named constant
26. Forces the computer to display decimal point and trailing zeroes
like-type expression
showpoint
floating-point
default constructor
27. Whole numbers - no decimals and no commas included
int values
void
Preprocessor
recursive function
28. Type casting syntax
static_cast<char>(65)
function prototype
beginning
scope
29. In inheritance the ____________ is the class the receives the inherited members.
dot (.)
mixed expression
derived class
function call
30. To explicitly indicate that a value is to be converted to another type
object file
special symbols
sorting
type casting (conversion)
31. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
selection
showpoint
object-oriented analysis and design (OOAD)
32. A function that can be used to read character data including whitespace
floating-point
heap
default constructor
cin.get(ch)
33. The process of placing the elements of an array in order is called ________ the array.
pointer
dot (.)
void
sorting
34. An expression that has operands with different data types
mixed expression
pointer
unary operator
main
35. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
arithmetic expression
inline functions
% modulus
classes
36. An array that uses two subscripts is referred to as a(n) _________ array.
unary scope resolution operator (::)
reserve words
two-dimensional
before
37. Words that are used for special purposes in a program
private
reserved words
static
{ }
38. Syntax for named constant declaration
endl (same as 'n')
information hiding
const datatype identifier = value
type casting (conversion)
39. A set of values together with a set of operations
data type
assignment
Unified Modeling Language(UML)
continue
40. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
polymorphism
break
preprocessor
41. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
object-oriented analysis and design (OOAD)
identifiers
private
42. Every C++ program begins execution at the function _________.
main
a.out
#include
break
43. A filestream variable that represents the default output device
.cpp
cout
pointer
sorting
44. 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.
a.out
recursive function
?
recursive
45. newline
t
n
selection
function parameters
46. The _________ begins the body of every function and the _________ ends the body of every function.
auto
endl (same as 'n')
srand
{ }
47. The address-of operator. it is used to assign pointers and to print the address of variables.
derived class
&
semantics
continue
48. Naming convention for C++ programs
reserved words
object-oriented analysis and design (OOAD)
type
.cpp
49. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
virtual functions
object file
access specifier
setw
50. The ________ qualifier is used to declare read-only variables.
scope resolution operator
information hiding
cout
const