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. These are data items whose values do not change while the program is running
prompt
function scope
//
Literals
2. Message displayed to the screen asking user for input; generated with an output statement
vectors
inheritance
Preprocessor
prompt
3. Function ________ is used to produce random numbers.
object file
rand
assignment statement
subscript (or index)
4. Symbol that denotes an action to be performed
::
local variable
derived class
operator
5. 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.
getline
Default memberwise assignment
virtual functions
integer operands
6. Default name of executable file
a.out
stack
#include directive
recursive
7. Nonexecutable statements that are included in a program to provide information about what the program does etc.
pointer
semantics
comments
scope
8. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
const
type casting (conversion)
access specifier
#include directive
9. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
two-dimensional
strlen()
#include
<<
10. Creates a copy of a string.
strcpy()
function call
Counter-controlled or definite
return
11. A human readable file that contains C++ program
#include directive
operator
return
source file
12. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
pointer
semantics
function scope
13. A __________ should be used to declare the size of an array because it makes the program more scalable.
reserve words
constant variable
allocating memory
type casting (conversion)
14. Used for function calls and local variables
source file
address
stack
named constant
15. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
assignment statement
preprocessor
setw
16. The three values that can be used to initialize a pointer are 0 - __________ and an address.
main
member
NULL
default constructor
17. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
recursive
public
srand
&
18. You must have a ___________ for every variable you intend to use in a program
inheritance
definition
Unified Modeling Language(UML)
?
19. An array that uses two subscripts is referred to as a(n) _________ array.
beginning
two-dimensional
function prototype
variables
20. 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.
#include directive
information hiding
constant variable
n
21. An expression in which all operands have the same data type - result will have the same data type as operands
variable
syntax
object file
like-type expression
22. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
function prototype
strcpy()
//
function call
23. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
auto
this
floating-point
allocating memory
24. The sign you use for references
a.out
global
new line
&
25. Sets floating-point values to a fixed decimal format
operator overloading
pointer
unary scope resolution operator (::)
fixed
26. 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
data type
0
Counter-controlled or definite
27. To write data to a file you define an object of which one of the following
semicolon
ofstream
local variable
n
28. A sequence of operands and operators that describe a calculation to be performed
recursive function
arithmetic expression
object-oriented analysis and design (OOAD)
function parameters
29. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
cin.get(ch)
Preprocessor
source file
30. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
global
pointer
static
arithmetic expression
31. The symbol for the binary scope resolution operator
a.out
getline
two-dimensional
::
32. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
operand value
friend
semicolon
scope resolution operator
33. Type casting syntax
operator
strcmp()
ofstream
static_cast<char>(65)
34. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
?
void
strcmp()
function parameters
35. The process of analyzing and designing a system from an object-oriented point of view is called ________.
setw
>>
object-oriented analysis and design (OOAD)
0
36. A __________ data member represents class-wide information.
&
static
#include directive
getline
37. Preprocessor directive syntax
int values
semicolon
Literals
#include <headerfilename>
38. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
% modulus
return
reserved words
.cpp
39. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.
Sentinel
virtual functions
special symbols
editor
40. Returns the length of a string excluding the null terminator.
cin >> variable
strlen()
sorting
classes
41. 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.
global
/n
void
getline
42. A C++ statement that makes a decision is ______.
if
assignment
#include directive
polymorphism
43. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
if...else
object-oriented analysis and design (OOAD)
t
44. Executable version of program
object file
Stack overflow
function prototype
strcmp()
45. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
operator
Stack overflow
continue
main
46. Most calculations are normally performed by ______ statements.
preprocessor
inheritance
delete
assignment
47. A variable that holds the address of another variable.
selection
pointer
auto
comments
48. Initializers __________ must be used to initialize constant members of a class.
strlen()
member
void pointer
attributes
49. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
#include <headerfilename>
::
classes
cin >> variable
50. __________ can be used to assign an object of a class to another object of the same class.
#include
Default memberwise assignment
fstream
recursive function