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. In inheritance the ____________ is the class the receives the inherited members.
mixed expression
scope
derived class
inline functions
2. The ________ of an identifier is the portion of the program in which the identifier can be used.
delete
left
scope
operator overloading
3. 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.
void pointer
dot (.)
pointer
cin
4. These are data items whose values do not change while the program is running
syntax
Literals
function parameters
like-type expression
5. The sign you use for pointers
pointer
preprocessor
*
main
6. 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.
heap
base
operand value
Sentinel
7. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
setw
continue
NULL
new line
8. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
globals
left
semantics
void pointer
9. A memory location with a name and data type - its content may be changed during program execution
Arithmetic Operators
function overloading
variable
preprocessor
10. The idea that you can call the same function and the output will depend on the type of object you're using.
NULL
searching
polymorphism
#include directive
11. For every opening brace in a C++ program there must be a ______________.
break
main
cmath
Closing brace
12. A function that calls itself
function call
?
operator overloading
recursive function
13. Message displayed to the screen asking user for input; generated with an output statement
prompt
setw
allocating memory
selection
14. Identifier or expression that is part of the calculation to be performed
function parameters
inheritance
private
operand value
15. Preprocessor directive syntax
.cpp
switch
cin.get(ch)
#include <headerfilename>
16. The address-of operator. it is used to assign pointers and to print the address of variables.
case sensitive
mixed expression
&
unary operator
17. 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.
fixed
static
private
inline functions
18. Keyword public is a(n) _________
vectors
attributes
access specifier
auto
19. 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.
pointer
void
variables
cout
20. Every C++ statement ends with a(n) _________.
stack
n
function prototype
semicolon
21. Names of things that are used in a program - can apply to variables & constants and functions
loader
object-oriented analysis and design (OOAD)
identifiers
editor
22. Allows the programmer to store a value in a variable
assignment statement
&
.cpp
return
23. An operator that can only be used with int values. result will always be an int.
*
% modulus
operator
type casting (conversion)
24. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
ofstream
source file
const datatype identifier = value
25. A function ________ enables a single function to be defined to perform a task on many different data types.
Arithmetic Operators
template
delete
semantics
26. A type of pointer that can point at objects of any data type.
void pointer
0
type casting (conversion)
unary scope resolution operator (::)
27. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
operand value
auto
assignment
subscript (or index)
28. To write data to a file you define an object of which one of the following
ofstream
information hiding
operator
function call
29. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
#include <headerfilename>
showpoint
type
30. Classes can have relationships with other classes. These relationships are called ________.
global
associations
Unified Modeling Language(UML)
information hiding
31. To allow file access in a program you must #include this header file.
private
fstream
derived class
semantics
32. The storage-class specifiers are mutable - auto - ________ - extern and static.
register
local variable
recursive
prompt
33. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
Stack overflow
register
allocating memory
like-type expression
34. Forces the computer to display decimal point and trailing zeroes
two-dimensional
showpoint
binary operator
0
35. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
//
preprocessor
named constant
local variable
36. The ________ statement in a called function passes the value of an expression back to the calling function.
int values
rand
return
object file
37. Used for dynamically allocated variables
const
% modulus
heap
function scope
38. Lists and tables of values can be stored in arrays or __________.
scope resolution operator
assignment statement
semicolon
vectors
39. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
40. Function ________ is used to set the random number seed to randomize a program.
switch
srand
register
int values
41. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
recursive
operator
comments
friend
42. Two slash marks ( // ) indicate __________ of a comment
beginning
strcpy()
prompt
semicolon
43. All C++ Variables are_________.
case sensitive
sorting
scope resolution operator
n
44. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
private
main
searching
register
45. 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.
<<
NULL
/n
whitespace
46. A pointer is a variable that contains as its value the____________ of another variable.
address
attributes
rand
const datatype identifier = value
47. Default name of executable file
strlen()
dot (.)
a.out
member
48. Member objects are constructed __________ their enclosing class object.
Literals
before
polymorphism
.cpp
49. __________ can be used to assign an object of a class to another object of the same class.
Preprocessor
Default memberwise assignment
srand
Unified Modeling Language(UML)
50. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
definition
Sentinel
preprocessor