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. 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.
Unified Modeling Language(UML)
assignment
data type
dot (.)
2. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
>>
semantics
allocating memory
type casting (conversion)
3. 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.
reserved words
Literals
static
classes
4. Sets floating-point values to a fixed decimal format
function prototype
derived class
srand
fixed
5. Associate an identifier with a memory location
allocating memory
searching
Arithmetic Operators
two-dimensional
6. Member objects are constructed __________ their enclosing class object.
classes
scope
before
template
7. If a member initializer is not provided for a member object of a class the object's __________ is called.
const
ofstream
rand
default constructor
8. For every opening brace in a C++ program there must be a ______________.
Closing brace
private
before
cin.get(ch)
9. Classes can have relationships with other classes. These relationships are called ________.
associations
token
break
operator
10. 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
base
vectors
address
case sensitive
11. To write data to a file you define an object of which one of the following
main
member
ofstream
#include directive
12. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
special symbols
void pointer
recursive function
13. A file must be ________ before data can be written to or read from it.
heap
static
fixed
opened
14. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
strlen()
base
if...else
15. To explicitly indicate that a value is to be converted to another type
endl (same as 'n')
static
definition
type casting (conversion)
16. = & | are examples of ____________.
special symbols
endl (same as 'n')
derived class
&
17. Allows the programmer to store a value in a variable
assignment statement
private
inheritance
void
18. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
.cpp
fstream
searching
friend
19. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
base class
recursive
char
access specifier
20. Used for function calls and local variables
classes
unary operator
n
stack
21. The process of placing the elements of an array in order is called ________ the array.
&
two-dimensional
binary operator
sorting
22. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
operator overloading
inline functions
scope
ofstream
23. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
recursive function
linker
pointer
#include <headerfilename>
24. Keyword public is a(n) _________
friend
heap
access specifier
source file
25. A filestream variable that represents the default input source
comments
variable
inheritance
cin
26. An expression in which all operands have the same data type - result will have the same data type as operands
initialized
like-type expression
searching
binary operator
27. All C++ Variables are_________.
case sensitive
&
assignment
int values
28. Initializers __________ must be used to initialize constant members of a class.
this
member
strcpy()
private
29. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
rand
prompt
char
classes
30. Grammar rules of the language; compiler will try to identify and locate syntax errors
local variable
syntax
Literals
dot (.)
31. Type casting syntax
Counter-controlled or definite
static_cast<char>(65)
integer operands
static
32. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
Semicolon
object file
function prototype
Unified Modeling Language(UML)
33. Used for dynamically allocated variables
heap
t
access specifier
srand
34. Operator with only one operand
ofstream
unary operator
char
variable
35. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
heap
cout
recursive
36. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
Unified Modeling Language(UML)
function scope
non-static
arithmetic expression
37. The stream extraction operator
>>
Semicolon
this
before
38. Class members specified as _________ are accessible anywhere an object of the class is in scope.
prompt
two-dimensional
public
linker
39. An expression that has operands with different data types
delete
pointer
mixed expression
::
40. Every C++ statement ends with a(n) _________.
semicolon
break
named constant
special symbols
41. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
Default memberwise assignment
pointer
loader
42. The idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
{ }
setw
reserve words
43. Symbol that denotes an action to be performed
friend
Unified Modeling Language(UML)
void pointer
operator
44. The size & shape & color and weight of an object are considered
Counter-controlled or definite
attributes
scope
new line
45. The three values that can be used to initialize a pointer are 0 - __________ and an address.
switch
variable
globals
NULL
46. int namespace include using return examples of ___________
member
derived class
reserve words
scope
47. Operator with two operands
fixed
Default memberwise assignment
pointer
binary operator
48. A set of values together with a set of operations
&
data type
inheritance
endl (same as 'n')
49. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
before
prompt
escape sequences
50. A __________ should be used to declare the size of an array because it makes the program more scalable.
::
constant variable
strcmp()
classes