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. Member objects are constructed __________ their enclosing class object.
a.out
srand
before
fstream
2. You must have a ___________ for every variable you intend to use in a program
cin >> variable
definition
arithmetic expression
type casting (conversion)
3. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
attributes
/n
inheritance
unary scope resolution operator (::)
4. Used for dynamically allocated variables
heap
named constant
function scope
pointer
5. Nonexecutable statements that are included in a program to provide information about what the program does etc.
vectors
comments
main
type coercion
6. A member function should be declared static if it does not access __________ class members.
Semicolon
non-static
allocating memory
access specifier
7. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
unary scope resolution operator (::)
strcpy()
n
8. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
void
allocating memory
sorting
endl (same as 'n')
9. The ________ statement in a called function passes the value of an expression back to the calling function.
return
cin.get(ch)
t
arithmetic expression
10. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
operator overloading
ofstream
globals
if...else
11. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
Preprocessor
Default memberwise assignment
auto
recursive
12. Whole numbers - no decimals and no commas included
arithmetic expression
int values
variable
unary operator
13. To allow file access in a program you must #include this header file.
fstream
strcpy()
stack
variables
14. The modulus operator (%) can be used only with __________.
non-static
.cpp
integer operands
classes
15. The only integer that can be assigned directly to a pointer is_____________.
classes
NULL
sorting
0
16. Operator with only one operand
Literals
unary operator
left
token
17. The ________ of an identifier is the portion of the program in which the identifier can be used.
const datatype identifier = value
scope
pointer
#include directive
18. All ______ must be declared before they are used.
local variable
pointer
variables
delete
19. Returns the length of a string excluding the null terminator.
classes
strlen()
vectors
continue
20. A memory location with a name and data type - its content may be changed during program execution
case sensitive
Stack overflow
variable
globals
21. A __________ data member represents class-wide information.
prompt
Preprocessor
static
allocating memory
22. 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.
public
Sentinel
NULL
const datatype identifier = value
23. An operator that can only be used with int values. result will always be an int.
% modulus
identifiers
srand
recursive function
24. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
.cpp
variable
unary scope resolution operator (::)
globals
25. The symbol for the binary scope resolution operator
::
associations
a.out
integer operands
26. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
//
auto
linker
strcpy()
27. data types that refer to numbers with decimals
#include <headerfilename>
overloading
const datatype identifier = value
floating-point
28. A function that calls itself
before
recursive function
inline functions
void pointer
29. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
//
floating-point
assignment statement
.cpp
30. 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.
access specifier
delete
default constructor
virtual functions
31. * / % + -
static_cast<char>(65)
break
Arithmetic Operators
Semicolon
32. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
Unified Modeling Language(UML)
void
break
function prototype
33. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
srand
global
semantics
mixed expression
34. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
variables
cin
void
35. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
mixed expression
like-type expression
selection
initialized
36. In inheritance the ____________ is the class the receives the inherited members.
Literals
stack
derived class
public
37. A pointer is a variable that contains as its value the____________ of another variable.
strlen()
&
escape sequences
address
38. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
switch
this
unary operator
39. A type of pointer that can point at objects of any data type.
fixed
associations
#include
void pointer
40. Allows the programmer to store a value in a variable
#include <headerfilename>
data type
named constant
assignment statement
41. The size & shape & color and weight of an object are considered
% modulus
attributes
&
dot (.)
42. The storage-class specifiers are mutable - auto - ________ - extern and static.
source file
semantics
register
escape sequences
43. An array that uses two subscripts is referred to as a(n) _________ array.
a.out
Literals
associations
two-dimensional
44. = & | are examples of ____________.
floating-point
n
searching
special symbols
45. An expression that has operands with different data types
mixed expression
if...else
preprocessor
pointer
46. A C++ statement that makes a decision is ______.
recursive function
if
cmath
named constant
47. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
associations
<<
recursive
return
48. Compares two strings and returns 0 if they are equal.
inheritance
strcmp()
binary operator
char
49. To explicitly indicate that a value is to be converted to another type
beginning
recursive function
type casting (conversion)
const datatype identifier = value
50. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
classes
strcmp()
loader
sorting