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. directive A statement that starts with a # is called a ____________.
object file
Preprocessor
opened
cin >> variable
2. A memory location with a name and data type - its content may be changed during program execution
opened
rand
preprocessor
variable
3. The _____ causes the contents of another file to be inserted into a program.
source file
return
#include directive
floating-point
4. The only integer that can be assigned directly to a pointer is_____________.
0
srand
semicolon
source file
5. The process of determining if an array contains a particular key value is called _________ the array.
searching
0
<<
fixed
6. The ________ program combines the output of the compiler with various library functions to produce an executable image.
0
linker
const
.cpp
7. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
char
showpoint
register
break
8. The idea that you can call the same function and the output will depend on the type of object you're using.
function parameters
polymorphism
Semicolon
if...else
9. A set of values together with a set of operations
syntax
fstream
function call
data type
10. These are data items whose values do not change while the program is running
#include
comments
Literals
assignment
11. A variable that is known only within the function in which it is defined is called a ________.
local variable
Arithmetic Operators
linker
a.out
12. Returns the length of a string excluding the null terminator.
strlen()
special symbols
recursive
strcmp()
13. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
type coercion
return
this
void
14. The __________ operator reclaims memory previously allocated by new.
operator
main
delete
globals
15. * / % + -
Arithmetic Operators
reserve words
integer operands
cmath
16. A variable that holds the address of another variable.
inheritance
heap
pointer
//
17. 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.
this
Semicolon
information hiding
comments
18. A program that finds and attaches to your program the indicated libraries for compilation
a.out
preprocessor
beginning
Arithmetic Operators
19. An expression in which all operands have the same data type - result will have the same data type as operands
comments
searching
like-type expression
subscript (or index)
20. A function is invoked with a ________.
t
?
object file
function call
21. 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.
base
static
like-type expression
prompt
22. int namespace include using return examples of ___________
access specifier
#include
operator
reserve words
23. A function that can be used to read character data including whitespace
continue
*
mixed expression
cin.get(ch)
24. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
heap
auto
*
overloading
25. When a value of one data type is implicitly (automatically) changed to another data type
Counter-controlled or definite
n
type coercion
//
26. Type casting syntax
virtual functions
return
function prototype
static_cast<char>(65)
27. 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
non-static
base
associations
% modulus
28. The process of placing the elements of an array in order is called ________ the array.
pointer
sorting
#include directive
t
29. To write data to a file you define an object of which one of the following
this
default constructor
ofstream
whitespace
30. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
object-oriented analysis and design (OOAD)
srand
/n
31. Program components in C++ are called functions and ________.
access specifier
new line
local variable
classes
32. = & | are examples of ____________.
inheritance
before
special symbols
searching
33. The storage-class specifiers are mutable - auto - ________ - extern and static.
editor
register
char
showpoint
34. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
non-static
escape sequences
this
pointer
35. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
case sensitive
#include directive
operator overloading
void pointer
36. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
editor
a.out
Literals
37. 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.
?
identifiers
function prototype
member
38. All C++ Variables are_________.
two-dimensional
cin.get(ch)
int values
case sensitive
39. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
operator overloading
break
attributes
delete
40. In inheritance the ____________ is the class the receives the inherited members.
return
Semicolon
mixed expression
derived class
41. Nonexecutable statements that are included in a program to provide information about what the program does etc.
pointer
NULL
reserved words
comments
42. Classes can have relationships with other classes. These relationships are called ________.
associations
strlen()
srand
overloading
43. The modulus operator (%) can be used only with __________.
*
integer operands
whitespace
named constant
44. The elements of an array are related by the fact that they have the same name and ___________.
type
derived class
selection
void pointer
45. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
a.out
if...else
unary scope resolution operator (::)
function overloading
46. Associate an identifier with a memory location
::
t
public
allocating memory
47. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
public
prompt
pointer
preprocessor
48. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
//
Arithmetic Operators
access specifier
49. The stream insertion operator
allocating memory
register
<<
&
50. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
0
sorting
pointer