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. Repeating a set of instructions a specific number of times is called_________repetition.
semantics
*
Counter-controlled or definite
preprocessor
2. 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.
classes
information hiding
static
void
3. Compares two strings and returns 0 if they are equal.
syntax
strcmp()
global
named constant
4. A filestream variable that represents the default input source
assignment statement
const
allocating memory
cin
5. The number used to refer to a particular element of an array is called its ________.
if
new line
special symbols
subscript (or index)
6. The modulus operator (%) can be used only with __________.
operator
assignment statement
integer operands
reserved words
7. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
public
static
/n
8. Most calculations are normally performed by ______ statements.
searching
assignment
assignment statement
.cpp
9. The three values that can be used to initialize a pointer are 0 - __________ and an address.
NULL
global
before
ofstream
10. Every C++ statement ends with a(n) _________.
vectors
cin
source file
semicolon
11. A function that can be used to read character data including whitespace
unary operator
opened
before
cin.get(ch)
12. __________ can be used to assign an object of a class to another object of the same class.
type
semantics
Default memberwise assignment
operand value
13. A function is invoked with a ________.
identifiers
source file
switch
function call
14. In inheritance the ____________ is the class that supplies the inherited members.
static
base class
Closing brace
source file
15. Sets floating-point values to a fixed decimal format
source file
#include directive
fixed
type casting (conversion)
16. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
variable
new line
continue
initialized
17. Creates a copy of a string.
whitespace
assignment
strcpy()
pointer
18. A function ________ enables a single function to be defined to perform a task on many different data types.
const
preprocessor
template
inheritance
19. 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.
linker
reserve words
function overloading
/n
20. A member function should be declared static if it does not access __________ class members.
loader
globals
information hiding
non-static
21. To allow file access in a program you must #include this header file.
register
fstream
main
rand
22. The ________ statement in a called function passes the value of an expression back to the calling function.
const
comments
operator overloading
return
23. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
derived class
if...else
endl (same as 'n')
type coercion
24. The sign you use for references
&
dot (.)
Default memberwise assignment
function call
25. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
named constant
preprocessor
mixed expression
26. 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.
0
?
linker
before
27. A sequence of operands and operators that describe a calculation to be performed
function scope
arithmetic expression
global
unary scope resolution operator (::)
28. The process of placing the elements of an array in order is called ________ the array.
&
fixed
int values
sorting
29. C++ programs are normally typed into a computer using a(n) ________ program.
#include
.cpp
unary operator
editor
30. To explicitly indicate that a value is to be converted to another type
a.out
reserve words
source file
type casting (conversion)
31. The _____ causes the contents of another file to be inserted into a program.
variable
#include directive
getline
pointer
32. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
globals
type
virtual functions
return
33. The sign you use for pointers
NULL
opened
classes
*
34. 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
stack
base
base class
/n
35. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
int values
attributes
token
36. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
semantics
#include
::
cin
37. To write data to a file you define an object of which one of the following
ofstream
left
void
function scope
38. A human readable file that contains C++ program
source file
left
function parameters
Default memberwise assignment
39. Initializers __________ must be used to initialize constant members of a class.
preprocessor
operator
member
type
40. 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.
like-type expression
void
ofstream
object-oriented analysis and design (OOAD)
41. Operator with two operands
cin.get(ch)
cin
binary operator
>>
42. Naming convention for C++ programs
.cpp
reserved words
char
new line
43. Function ________ is used to produce random numbers.
int values
rand
data type
char
44. Default name of executable file
a.out
scope
const datatype identifier = value
switch
45. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
subscript (or index)
<<
operand value
46. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
heap
preprocessor
variable
overloading
47. The ________ program combines the output of the compiler with various library functions to produce an executable image.
identifiers
function call
linker
fstream
48. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
overloading
function prototype
return
semantics
49. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
classes
n
definition
Stack overflow
50. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
token
Stack overflow
named constant
cin >> variable