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. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
source file
return
semantics
Closing brace
2. The _________ begins the body of every function and the _________ ends the body of every function.
>>
{ }
identifiers
dot (.)
3. Syntax for named constant declaration
semantics
main
<<
const datatype identifier = value
4. Preprocessor directive syntax
#include <headerfilename>
&
whitespace
data type
5. A ________ program executes before the compiler's translation phase begins.
main
getline
t
preprocessor
6. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
Preprocessor
pointer
NULL
variable
7. Sets floating-point values to a fixed decimal format
fixed
new line
global
scope resolution operator
8. Function ________ is used to set the random number seed to randomize a program.
static
scope
srand
auto
9. Member objects are constructed __________ their enclosing class object.
main
const
before
derived class
10. Naming convention for C++ programs
function prototype
.cpp
access specifier
definition
11. int namespace include using return examples of ___________
opened
switch
token
reserve words
12. A function ________ enables a single function to be defined to perform a task on many different data types.
getline
before
register
template
13. A sequence of operands and operators that describe a calculation to be performed
identifiers
arithmetic expression
reserved words
>>
14. A __________ should be used to declare the size of an array because it makes the program more scalable.
derived class
opened
constant variable
type
15. The sign you use for references
semantics
&
switch
::
16. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
Counter-controlled or definite
inline functions
Sentinel
strcmp()
17. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
Arithmetic Operators
?
auto
return
18. You must have a ___________ for every variable you intend to use in a program
definition
default constructor
named constant
Closing brace
19. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
globals
escape sequences
searching
recursive
20. These are data items whose values do not change while the program is running
Literals
setw
globals
polymorphism
21. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
classes
this
private
Sentinel
22. Whole numbers - no decimals and no commas included
cin >> variable
int values
binary operator
non-static
23. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
base
int values
semantics
named constant
24. If a member initializer is not provided for a member object of a class the object's __________ is called.
showpoint
setw
base
default constructor
25. = & | are examples of ____________.
special symbols
overloading
//
linker
26. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
whitespace
//
Preprocessor
before
27. Executable version of program
>>
source file
object file
base
28. For every opening brace in a C++ program there must be a ______________.
Closing brace
data type
virtual functions
overloading
29. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
strlen()
Preprocessor
operator overloading
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.
operator overloading
cin
char
virtual functions
31. 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.
selection
/n
operand value
return
32. 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.
strcmp()
void
return
dot (.)
33. A function that calls itself
Stack overflow
unary operator
token
recursive function
34. To write data to a file you define an object of which one of the following
default constructor
const
ofstream
function prototype
35. The process of analyzing and designing a system from an object-oriented point of view is called ________.
derived class
whitespace
return
object-oriented analysis and design (OOAD)
36. A variable that holds the address of another variable.
&
strcmp()
pointer
function overloading
37. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
void
reserved words
static_cast<char>(65)
38. A pointer is a variable that contains as its value the____________ of another variable.
associations
binary operator
address
escape sequences
39. The address-of operator. it is used to assign pointers and to print the address of variables.
virtual functions
&
operator overloading
base
40. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
fixed
type coercion
function prototype
41. A file must be ________ before data can be written to or read from it.
opened
pointer
comments
>>
42. Keyword public is a(n) _________
access specifier
escape sequences
type
source file
43. A memory location with a name and data type - its content may be changed during program execution
#include <headerfilename>
cin.get(ch)
variable
strcpy()
44. 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.
inheritance
endl (same as 'n')
beginning
vectors
45. Repeating a set of instructions a specific number of times is called_________repetition.
before
access specifier
Counter-controlled or definite
identifiers
46. The only integer that can be assigned directly to a pointer is_____________.
n
0
address
if...else
47. Classes can have relationships with other classes. These relationships are called ________.
identifiers
private
selection
associations
48. Initializers __________ must be used to initialize constant members of a class.
<<
member
assignment statement
variables
49. The modulus operator (%) can be used only with __________.
cin.get(ch)
function scope
preprocessor
integer operands
50. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
heap
continue
pointer
function scope