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 specified as _________ are accessible anywhere an object of the class is in scope.
virtual functions
if
public
switch
2. Used to qualify hidden names so that they can be used.
stack
scope resolution operator
% modulus
information hiding
3. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
recursive
return
void
strlen()
4. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
left
int values
function prototype
friend
5. Every C++ program begins execution at the function _________.
cmath
t
left
main
6. Operator with only one operand
Unified Modeling Language(UML)
continue
unary operator
operand value
7. The process of determining if an array contains a particular key value is called _________ the array.
register
comments
preprocessor
searching
8. data types that refer to numbers with decimals
dot (.)
cin
floating-point
constant variable
9. This manipulator is used to establish a field width for the value immediately following it.
definition
setw
switch
classes
10. Preprocessor directive syntax
#include <headerfilename>
?
static
semicolon
11. The sign you use for pointers
left
escape sequences
reserve words
*
12. A C++ statement that makes a decision is ______.
member
friend
pointer
if
13. Sets floating-point values to a fixed decimal format
private
this
fixed
floating-point
14. Operator with two operands
semantics
binary operator
reserved words
endl (same as 'n')
15. directive A statement that starts with a # is called a ____________.
type coercion
escape sequences
arithmetic expression
Preprocessor
16. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
n
unary scope resolution operator (::)
private
17. The symbol for the binary scope resolution operator
::
Semicolon
% modulus
special symbols
18. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
heap
cin.get(ch)
selection
19. Function ________ is used to set the random number seed to randomize a program.
definition
*
vectors
srand
20. You must have a ___________ for every variable you intend to use in a program
definition
n
getline
associations
21. A function is invoked with a ________.
information hiding
recursive
escape sequences
function call
22. 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.
cout
inheritance
case sensitive
loader
23. The ________ of an identifier is the portion of the program in which the identifier can be used.
operand value
scope
inline functions
dot (.)
24. Type casting syntax
static_cast<char>(65)
cmath
selection
linker
25. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
ofstream
preprocessor
globals
semantics
26. An expression in which all operands have the same data type - result will have the same data type as operands
heap
token
like-type expression
cin.get(ch)
27. A memory location with a name and data type - its content may be changed during program execution
void
function overloading
recursive
variable
28. Returns the length of a string excluding the null terminator.
strlen()
binary operator
arithmetic expression
default constructor
29. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
linker
a.out
getline
return
30. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
t
Default memberwise assignment
private
public
31. Function ________ is used to produce random numbers.
rand
assignment statement
void pointer
non-static
32. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
function prototype
operator overloading
srand
if...else
33. Nonexecutable statements that are included in a program to provide information about what the program does etc.
cmath
cin
function prototype
comments
34. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
new line
initialized
beginning
cin.get(ch)
35. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
token
definition
friend
36. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
variable
#include
const
operand value
37. Naming convention for C++ programs
friend
Preprocessor
function call
.cpp
38. A filestream variable that represents the default input source
this
cin
endl (same as 'n')
const datatype identifier = value
39. Identifier or expression that is part of the calculation to be performed
inheritance
operand value
function parameters
static_cast<char>(65)
40. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
//
void pointer
this
41. Whole numbers - no decimals and no commas included
int values
0
rand
auto
42. 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
cmath
const datatype identifier = value
Semicolon
43. Compares two strings and returns 0 if they are equal.
if
public
strcmp()
cin.get(ch)
44. To explicitly indicate that a value is to be converted to another type
if...else
type casting (conversion)
semantics
definition
45. A variable declared outside any block or function is a ________ variable.
global
function prototype
arithmetic expression
scope resolution operator
46. The modulus operator (%) can be used only with __________.
case sensitive
integer operands
source file
function prototype
47. 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.
auto
subscript (or index)
dot (.)
const
48. The stream insertion operator
recursive
void
main
<<
49. A constant object must be __________; it cannot be modified after it is created.
static
break
initialized
named constant
50. Symbol that denotes an action to be performed
auto
operator
linker
type casting (conversion)