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 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.
/n
before
default constructor
loader
2. A function that can be used to read character data including whitespace
cin.get(ch)
switch
reserve words
getline
3. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
left
function prototype
scope
new line
4. Header file that contains commonly performed mathematical functions
whitespace
cmath
initialized
preprocessor
5. The __________ operator reclaims memory previously allocated by new.
assignment statement
delete
static
strcmp()
6. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
source file
srand
operator
friend
7. The storage-class specifiers are mutable - auto - ________ - extern and static.
?
register
polymorphism
default constructor
8. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
type
function prototype
continue
new line
9. __________ can be used to assign an object of a class to another object of the same class.
operand value
Default memberwise assignment
reserved words
return
10. newline
const datatype identifier = value
function call
n
cmath
11. Nonexecutable statements that are included in a program to provide information about what the program does etc.
binary operator
const datatype identifier = value
comments
source file
12. The _________ begins the body of every function and the _________ ends the body of every function.
a.out
{ }
if
void pointer
13. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
if...else
return
private
#include <headerfilename>
14. To allow file access in a program you must #include this header file.
access specifier
type
address
fstream
15. tab
t
globals
template
function prototype
16. In inheritance the ____________ is the class the receives the inherited members.
rand
mixed expression
derived class
inline functions
17. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
definition
static
int values
18. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
overloading
#include
auto
integer operands
19. The symbol for the binary scope resolution operator
special symbols
address
::
function parameters
20. Returns the length of a string excluding the null terminator.
preprocessor
strlen()
sorting
cin >> variable
21. An expression that has operands with different data types
return
allocating memory
operand value
mixed expression
22. 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.
dot (.)
Stack overflow
if
return
23. For every opening brace in a C++ program there must be a ______________.
recursive
Closing brace
Default memberwise assignment
void
24. Initializers __________ must be used to initialize constant members of a class.
getline
cin.get(ch)
member
operator overloading
25. 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.
pointer
recursive function
heap
void
26. When a value of one data type is implicitly (automatically) changed to another data type
non-static
type coercion
object-oriented analysis and design (OOAD)
return
27. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
<<
overloading
object file
like-type expression
28. An operator that can only be used with int values. result will always be an int.
this
prompt
operand value
% modulus
29. A constant object must be __________; it cannot be modified after it is created.
Preprocessor
initialized
scope resolution operator
main
30. Grammar rules of the language; compiler will try to identify and locate syntax errors
two-dimensional
sorting
syntax
char
31. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
Literals
editor
ofstream
globals
32. The ________ program transfers the executable image of a C++ program from disk to memory.
loader
fstream
unary operator
char
33. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
break
Preprocessor
<<
data type
34. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
<<
Default memberwise assignment
named constant
definition
35. Used for dynamically allocated variables
mixed expression
base class
heap
operand value
36. A file must be ________ before data can be written to or read from it.
.cpp
switch
opened
/n
37. Used to qualify hidden names so that they can be used.
scope resolution operator
definition
arithmetic expression
reserve words
38. This manipulator causes the field to be left-justified with padding spaces printed to the right.
escape sequences
function parameters
const
left
39. You can declare default values for a function in the ____________________.
if...else
unary operator
function overloading
function parameters
40. Words that are used for special purposes in a program
semicolon
beginning
unary operator
reserved words
41. Executable version of program
object file
main
continue
operator
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.
left
static
syntax
editor
43. A set of values together with a set of operations
constant variable
data type
reserve words
before
44. Allows the programmer to store a value in a variable
assignment statement
operand value
void
arithmetic expression
45. The elements of an array are related by the fact that they have the same name and ___________.
type
return
base
friend
46. A pointer is a variable that contains as its value the____________ of another variable.
address
private
pointer
register
47. A member function should be declared static if it does not access __________ class members.
unary scope resolution operator (::)
arithmetic expression
non-static
operator overloading
48. Every C++ program begins execution at the function _________.
fixed
main
n
public
49. The sign you use for pointers
switch
special symbols
*
friend
50. = & | are examples of ____________.
special symbols
strcmp()
const
operator