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. The size & shape & color and weight of an object are considered
attributes
heap
getline
recursive function
2. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
reserve words
data type
new line
char
3. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
#include <headerfilename>
return
reserve words
4. Grammar rules of the language; compiler will try to identify and locate syntax errors
cin.get(ch)
token
endl (same as 'n')
syntax
5. directive A statement that starts with a # is called a ____________.
register
new line
polymorphism
Preprocessor
6. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
classes
selection
::
Stack overflow
7. An expression that has operands with different data types
reserve words
mixed expression
endl (same as 'n')
information hiding
8. All ______ must be declared before they are used.
*
variables
private
assignment statement
9. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
floating-point
fstream
cin >> variable
reserve words
10. * / % + -
reserve words
two-dimensional
Arithmetic Operators
private
11. A file must be ________ before data can be written to or read from it.
opened
global
Semicolon
variables
12. Operator with two operands
special symbols
binary operator
friend
a.out
13. If a member initializer is not provided for a member object of a class the object's __________ is called.
cmath
default constructor
unary operator
a.out
14. The ________ program combines the output of the compiler with various library functions to produce an executable image.
linker
beginning
stack
static_cast<char>(65)
15. Preprocessor directive syntax
local variable
const datatype identifier = value
#include <headerfilename>
reserve words
16. 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.
variables
virtual functions
scope
named constant
17. 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.
assignment statement
/n
static
void pointer
18. The process of placing the elements of an array in order is called ________ the array.
whitespace
cout
searching
sorting
19. The stream extraction operator
>>
preprocessor
special symbols
operator
20. For every opening brace in a C++ program there must be a ______________.
Closing brace
>>
cout
endl (same as 'n')
21. A variable that holds the address of another variable.
Semicolon
reserve words
pointer
return
22. A memory location with a name and data type - its content may be changed during program execution
initialized
a.out
variable
Closing brace
23. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
if...else
Sentinel
variable
preprocessor
24. Returns the length of a string excluding the null terminator.
object-oriented analysis and design (OOAD)
polymorphism
strlen()
register
25. 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.
srand
operand value
dot (.)
Stack overflow
26. The address-of operator. it is used to assign pointers and to print the address of variables.
cin
&
static
type
27. An operator that can only be used with int values. result will always be an int.
main
% modulus
beginning
member
28. 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.
delete
/n
Counter-controlled or definite
getline
29. 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
global
base
semantics
30. 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
globals
a.out
two-dimensional
base
31. Compares two strings and returns 0 if they are equal.
strlen()
stack
n
strcmp()
32. The stream insertion operator
Closing brace
<<
access specifier
constant variable
33. Forces the computer to display decimal point and trailing zeroes
special symbols
auto
new line
showpoint
34. Keyword public is a(n) _________
cout
return
access specifier
overloading
35. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
::
this
break
return
36. A human readable file that contains C++ program
//
strlen()
access specifier
source file
37. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
subscript (or index)
getline
continue
object file
38. Default name of executable file
integer operands
a.out
static
special symbols
39. Most calculations are normally performed by ______ statements.
left
case sensitive
assignment
return
40. The ________ program transfers the executable image of a C++ program from disk to memory.
loader
Unified Modeling Language(UML)
globals
cin >> variable
41. C++ programs are normally typed into a computer using a(n) ________ program.
constant variable
//
editor
function call
42. Used for dynamically allocated variables
if
local variable
heap
variable
43. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
ofstream
recursive
reserve words
44. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
cout
Sentinel
inline functions
data type
45. The symbol for the binary scope resolution operator
named constant
::
continue
member
46. The three values that can be used to initialize a pointer are 0 - __________ and an address.
NULL
binary operator
::
auto
47. To explicitly indicate that a value is to be converted to another type
type casting (conversion)
assignment
two-dimensional
/n
48. These are data items whose values do not change while the program is running
if...else
linker
Literals
template
49. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
getline
cin
?
50. Symbol that denotes an action to be performed
inheritance
default constructor
cin
operator