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 modulus operator (%) can be used only with __________.
/n
polymorphism
static
integer operands
2. Allows the programmer to store a value in a variable
reserved words
assignment statement
recursive
new line
3. Compares two strings and returns 0 if they are equal.
strcmp()
void pointer
operator overloading
access specifier
4. A program that finds and attaches to your program the indicated libraries for compilation
vectors
preprocessor
delete
Arithmetic Operators
5. * / % + -
Arithmetic Operators
globals
Default memberwise assignment
identifiers
6. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
virtual functions
binary operator
associations
7. The ________ program transfers the executable image of a C++ program from disk to memory.
main
Default memberwise assignment
Literals
loader
8. The symbol for the binary scope resolution operator
::
linker
dot (.)
virtual functions
9. The sign you use for references
main
&
heap
assignment statement
10. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
semantics
data type
void
11. The ________ of an identifier is the portion of the program in which the identifier can be used.
globals
address
scope
0
12. Whole numbers - no decimals and no commas included
private
attributes
int values
inline functions
13. 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.
if...else
comments
NULL
/n
14. data types that refer to numbers with decimals
{ }
floating-point
main
source file
15. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
attributes
subscript (or index)
cout
16. The __________ operator reclaims memory previously allocated by new.
default constructor
prompt
delete
searching
17. Associate an identifier with a memory location
function overloading
attributes
whitespace
allocating memory
18. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
cin
break
static
19. = & | are examples of ____________.
escape sequences
&
#include
special symbols
20. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
function call
pointer
switch
object-oriented analysis and design (OOAD)
21. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
return
type coercion
ofstream
22. C++ programs are normally typed into a computer using a(n) ________ program.
editor
searching
const
this
23. The ________ qualifier is used to declare read-only variables.
stack
polymorphism
const
editor
24. All C++ Variables are_________.
friend
polymorphism
case sensitive
#include directive
25. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
beginning
dot (.)
void
26. A set of values together with a set of operations
new line
data type
floating-point
register
27. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
private
if...else
static
register
28. A pointer is a variable that contains as its value the____________ of another variable.
mixed expression
stack
type casting (conversion)
address
29. directive A statement that starts with a # is called a ____________.
switch
assignment statement
Preprocessor
n
30. To explicitly indicate that a value is to be converted to another type
showpoint
classes
type casting (conversion)
Sentinel
31. The ________ statement in a called function passes the value of an expression back to the calling function.
return
ofstream
reserved words
derived class
32. To allow file access in a program you must #include this header file.
fstream
&
setw
constant variable
33. A __________ should be used to declare the size of an array because it makes the program more scalable.
pointer
semicolon
Arithmetic Operators
constant variable
34. This manipulator causes the field to be left-justified with padding spaces printed to the right.
{ }
cin
local variable
left
35. The _____ causes the contents of another file to be inserted into a program.
reserve words
scope resolution operator
#include directive
{ }
36. To write data to a file you define an object of which one of the following
globals
vectors
dot (.)
ofstream
37. The storage-class specifiers are mutable - auto - ________ - extern and static.
endl (same as 'n')
register
identifiers
Default memberwise assignment
38. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
linker
Sentinel
new line
virtual functions
39. A function ________ enables a single function to be defined to perform a task on many different data types.
this
floating-point
Literals
template
40. Symbol that denotes an action to be performed
strcmp()
reserve words
operator
*
41. 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
ofstream
.cpp
base
initialized
42. An expression that has operands with different data types
Semicolon
mixed expression
semicolon
function overloading
43. 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.
variables
ofstream
linker
dot (.)
44. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
function call
classes
semantics
subscript (or index)
45. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
attributes
semicolon
definition
Stack overflow
46. A human readable file that contains C++ program
left
strcmp()
source file
return
47. In inheritance the ____________ is the class the receives the inherited members.
Literals
non-static
rand
derived class
48. Preprocessor directive syntax
fstream
Default memberwise assignment
sorting
#include <headerfilename>
49. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
assignment statement
left
classes
overloading
50. Naming convention for C++ programs
floating-point
base
.cpp
delete