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 three values that can be used to initialize a pointer are 0 - __________ and an address.
char
fixed
NULL
semicolon
2. Associate an identifier with a memory location
a.out
variable
strlen()
allocating memory
3. You can declare default values for a function in the ____________________.
void
whitespace
function parameters
left
4. This is used to mark the end of a complete C++ programming statement.
Semicolon
floating-point
prompt
pointer
5. A member function should be declared static if it does not access __________ class members.
unary scope resolution operator (::)
non-static
register
::
6. 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.
Arithmetic Operators
information hiding
&
>>
7. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
inheritance
strlen()
recursive
cout
8. A program that finds and attaches to your program the indicated libraries for compilation
source file
function parameters
preprocessor
operator overloading
9. A function that can be used to read character data including whitespace
Semicolon
type coercion
char
cin.get(ch)
10. A filestream variable that represents the default input source
public
cin
address
function overloading
11. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
{ }
const
assignment
assignment statement
12. C++ programs are normally typed into a computer using a(n) ________ program.
strcpy()
main
editor
strlen()
13. The sign you use for pointers
static
ofstream
{ }
*
14. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
Default memberwise assignment
showpoint
operator overloading
15. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
getline
register
srand
delete
16. Operator with two operands
Unified Modeling Language(UML)
fstream
main
binary operator
17. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
#include <headerfilename>
auto
function scope
data type
18. Type casting syntax
mixed expression
static_cast<char>(65)
fstream
address
19. int namespace include using return examples of ___________
const
if...else
reserve words
pointer
20. The elements of an array are related by the fact that they have the same name and ___________.
type
return
inheritance
Closing brace
21. 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.
a.out
Sentinel
recursive function
reserved words
22. Initializers __________ must be used to initialize constant members of a class.
member
subscript (or index)
Default memberwise assignment
char
23. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
token
stack
classes
void
24. The ________ statement in a called function passes the value of an expression back to the calling function.
return
attributes
unary operator
selection
25. Message displayed to the screen asking user for input; generated with an output statement
member
attributes
prompt
::
26. A pointer is a variable that contains as its value the____________ of another variable.
cmath
cin
address
overloading
27. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
subscript (or index)
private
{ }
information hiding
28. A sequence of operands and operators that describe a calculation to be performed
comments
arithmetic expression
derived class
return
29. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
identifiers
operator overloading
new line
Stack overflow
30. Words that are used for special purposes in a program
function scope
information hiding
reserved words
t
31. 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
cin.get(ch)
floating-point
inline functions
32. To explicitly indicate that a value is to be converted to another type
const
type casting (conversion)
void pointer
strcpy()
33. Lists and tables of values can be stored in arrays or __________.
{ }
vectors
register
showpoint
34. Program components in C++ are called functions and ________.
case sensitive
classes
Default memberwise assignment
<<
35. The _________ begins the body of every function and the _________ ends the body of every function.
integer operands
a.out
{ }
switch
36. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
cin >> variable
auto
Default memberwise assignment
static_cast<char>(65)
37. Most calculations are normally performed by ______ statements.
//
assignment
dot (.)
derived class
38. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
const
//
special symbols
void
39. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
named constant
syntax
constant variable
40. You must have a ___________ for every variable you intend to use in a program
definition
template
prompt
#include
41. All ______ must be declared before they are used.
variables
t
scope
Default memberwise assignment
42. 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.
Counter-controlled or definite
//
?
preprocessor
43. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
showpoint
constant variable
Stack overflow
44. Allows the programmer to store a value in a variable
break
left
assignment statement
preprocessor
45. 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.
virtual functions
global
function prototype
assignment statement
46. The ________ qualifier is used to declare read-only variables.
local variable
address
type casting (conversion)
const
47. The sign you use for references
&
classes
<<
return
48. A constant object must be __________; it cannot be modified after it is created.
assignment
initialized
t
friend
49. The address-of operator. it is used to assign pointers and to print the address of variables.
&
globals
NULL
default constructor
50. Use 2 characters to represent one
escape sequences
mixed expression
integer operands
inheritance