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. All C++ Variables are_________.
special symbols
friend
case sensitive
>>
2. A C++ statement that makes a decision is ______.
if
derived class
data type
t
3. newline
access specifier
semantics
cin.get(ch)
n
4. The address-of operator. it is used to assign pointers and to print the address of variables.
global
register
//
&
5. data types that refer to numbers with decimals
token
object file
scope
floating-point
6. Used for function calls and local variables
non-static
stack
unary scope resolution operator (::)
cin >> variable
7. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
static
address
if...else
semantics
8. If a member initializer is not provided for a member object of a class the object's __________ is called.
break
default constructor
virtual functions
escape sequences
9. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
variable
*
function overloading
continue
10. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
&
friend
template
char
11. Initializers __________ must be used to initialize constant members of a class.
member
rand
case sensitive
type
12. Lists and tables of values can be stored in arrays or __________.
identifiers
return
vectors
register
13. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
derived class
preprocessor
strcmp()
pointer
14. Used to qualify hidden names so that they can be used.
overloading
comments
scope resolution operator
cin >> variable
15. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
template
special symbols
preprocessor
16. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
scope
Default memberwise assignment
break
local variable
17. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
type
Preprocessor
type coercion
18. Most calculations are normally performed by ______ statements.
information hiding
scope
Unified Modeling Language(UML)
assignment
19. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
function parameters
identifiers
cin.get(ch)
20. A function that can be used to read character data including whitespace
setw
cin.get(ch)
classes
friend
21. To write data to a file you define an object of which one of the following
ofstream
inline functions
getline
endl (same as 'n')
22. Function ________ is used to set the random number seed to randomize a program.
member
address
auto
srand
23. 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
register
beginning
classes
24. 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.
static
if...else
data type
Default memberwise assignment
25. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
integer operands
getline
char
void pointer
26. The size & shape & color and weight of an object are considered
loader
attributes
globals
scope resolution operator
27. 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 (.)
binary operator
subscript (or index)
prompt
28. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
inline functions
#include
assignment
semantics
29. In inheritance the ____________ is the class that supplies the inherited members.
binary operator
base class
this
Preprocessor
30. A file must be ________ before data can be written to or read from it.
Arithmetic Operators
continue
function scope
opened
31. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
scope
two-dimensional
private
continue
32. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
cin >> variable
before
preprocessor
this
33. A memory location with a name and data type - its content may be changed during program execution
variable
preprocessor
variables
static
34. The only integer that can be assigned directly to a pointer is_____________.
0
a.out
reserve words
sorting
35. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
access specifier
const
cin >> variable
#include
36. To explicitly indicate that a value is to be converted to another type
::
type casting (conversion)
function call
continue
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.
?
new line
loader
type coercion
38. Function ________ is used to produce random numbers.
cin.get(ch)
sorting
rand
non-static
39. The elements of an array are related by the fact that they have the same name and ___________.
#include
type
mixed expression
semicolon
40. A sequence of operands and operators that describe a calculation to be performed
arithmetic expression
>>
Default memberwise assignment
base class
41. Type casting syntax
static_cast<char>(65)
source file
NULL
?
42. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
classes
rand
switch
const datatype identifier = value
43. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
allocating memory
special symbols
Stack overflow
const datatype identifier = value
44. The process of determining if an array contains a particular key value is called _________ the array.
showpoint
const datatype identifier = value
classes
searching
45. A constant object must be __________; it cannot be modified after it is created.
initialized
global
cmath
showpoint
46. The stream extraction operator
linker
>>
register
loader
47. An expression in which all operands have the same data type - result will have the same data type as operands
selection
like-type expression
return
showpoint
48. * / % + -
address
.cpp
Arithmetic Operators
virtual functions
49. Operator with two operands
binary operator
cout
public
preprocessor
50. The three values that can be used to initialize a pointer are 0 - __________ and an address.
type coercion
NULL
operator overloading
overloading