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. Syntax for named constant declaration
int values
derived class
unary scope resolution operator (::)
const datatype identifier = value
2. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
reserved words
&
static
Stack overflow
3. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
pointer
/n
cin
4. The address-of operator. it is used to assign pointers and to print the address of variables.
#include
n
&
base
5. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
case sensitive
register
>>
const
6. Every C++ program begins execution at the function _________.
main
overloading
inline functions
?
7. In inheritance the ____________ is the class the receives the inherited members.
derived class
template
showpoint
friend
8. A type of pointer that can point at objects of any data type.
#include
void pointer
stack
definition
9. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
static_cast<char>(65)
Literals
Sentinel
10. For every opening brace in a C++ program there must be a ______________.
stack
Closing brace
cin
local variable
11. Type casting syntax
mixed expression
#include directive
binary operator
static_cast<char>(65)
12. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
vectors
srand
#include
13. Identifier or expression that is part of the calculation to be performed
operand value
int values
const
private
14. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
classes
virtual functions
pointer
15. directive A statement that starts with a # is called a ____________.
#include directive
Semicolon
Preprocessor
heap
16. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
variable
object file
static
new line
17. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
?
globals
&
&
18. This manipulator causes the field to be left-justified with padding spaces printed to the right.
void
left
function overloading
preprocessor
19. When a value of one data type is implicitly (automatically) changed to another data type
assignment statement
type coercion
0
reserved words
20. The ________ program transfers the executable image of a C++ program from disk to memory.
syntax
non-static
loader
function call
21. Whole numbers - no decimals and no commas included
function prototype
int values
identifiers
base class
22. Associate an identifier with a memory location
NULL
inheritance
allocating memory
Semicolon
23. A program that finds and attaches to your program the indicated libraries for compilation
data type
preprocessor
subscript (or index)
variables
24. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
binary operator
selection
initialized
Semicolon
25. Allows the programmer to store a value in a variable
integer operands
assignment statement
if
Counter-controlled or definite
26. A filestream variable that represents the default output device
whitespace
::
cout
public
27. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
initialized
getline
escape sequences
scope resolution operator
28. Function ________ is used to produce random numbers.
rand
type casting (conversion)
stack
public
29. 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.
t
inheritance
dot (.)
object file
30. Grammar rules of the language; compiler will try to identify and locate syntax errors
semantics
syntax
>>
stack
31. The idea that you can call the same function and the output will depend on the type of object you're using.
address
reserved words
assignment
polymorphism
32. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
assignment
*
rand
return
33. A set of values together with a set of operations
object-oriented analysis and design (OOAD)
reserve words
void pointer
data type
34. Returns the length of a string excluding the null terminator.
strlen()
definition
stack
auto
35. Forces the computer to display decimal point and trailing zeroes
prompt
operator overloading
showpoint
type casting (conversion)
36. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
static
new line
polymorphism
37. All ______ must be declared before they are used.
object-oriented analysis and design (OOAD)
variables
classes
derived class
38. All C++ Variables are_________.
heap
/n
strcpy()
case sensitive
39. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
object file
NULL
overloading
variables
40. tab
const datatype identifier = value
polymorphism
t
*
41. A filestream variable that represents the default input source
binary operator
void pointer
cin
private
42. 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.
base
information hiding
static
Sentinel
43. The __________ operator reclaims memory previously allocated by new.
two-dimensional
delete
?
ofstream
44. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
access specifier
recursive
scope
assignment
45. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
this
Arithmetic Operators
static
cin
46. A memory location with a name and data type - its content may be changed during program execution
function call
variable
cmath
const datatype identifier = value
47. Every C++ statement ends with a(n) _________.
function prototype
return
semicolon
prompt
48. A function ________ enables a single function to be defined to perform a task on many different data types.
cin >> variable
left
static
template
49. 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
0
operator overloading
50. Characters used to separate symbols or reserved words or identifiers and statements
overloading
whitespace
Closing brace
getline