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. A __________ should be used to declare the size of an array because it makes the program more scalable.
.cpp
unary operator
variable
constant variable
2. Every C++ program begins execution at the function _________.
Closing brace
function prototype
classes
main
3. The only integer that can be assigned directly to a pointer is_____________.
switch
0
rand
strlen()
4. = & | are examples of ____________.
special symbols
local variable
showpoint
arithmetic expression
5. Two slash marks ( // ) indicate __________ of a comment
named constant
beginning
Preprocessor
continue
6. The stream insertion operator
<<
base
syntax
endl (same as 'n')
7. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
0
if...else
friend
char
8. Sets floating-point values to a fixed decimal format
int values
type
fixed
cout
9. An expression that has operands with different data types
function overloading
mixed expression
function scope
overloading
10. A type of pointer that can point at objects of any data type.
scope
virtual functions
void pointer
data type
11. Keyword public is a(n) _________
beginning
Counter-controlled or definite
access specifier
searching
12. These are data items whose values do not change while the program is running
Literals
0
scope resolution operator
?
13. Preprocessor directive syntax
friend
Semicolon
#include <headerfilename>
a.out
14. An array that uses two subscripts is referred to as a(n) _________ array.
fstream
two-dimensional
return
unary operator
15. An expression in which all operands have the same data type - result will have the same data type as operands
template
Default memberwise assignment
sorting
like-type expression
16. A ________ program executes before the compiler's translation phase begins.
strlen()
n
address
preprocessor
17. In inheritance the ____________ is the class the receives the inherited members.
derived class
auto
comments
void
18. The process of determining if an array contains a particular key value is called _________ the array.
searching
recursive function
data type
classes
19. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
function call
type coercion
friend
floating-point
20. Message displayed to the screen asking user for input; generated with an output statement
prompt
floating-point
Semicolon
initialized
21. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
syntax
&
inheritance
inline functions
22. The __________ operator reclaims memory previously allocated by new.
binary operator
function prototype
delete
showpoint
23. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
data type
static
break
void
24. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
syntax
definition
static
private
25. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
searching
Closing brace
vectors
overloading
26. data types that refer to numbers with decimals
*
Literals
floating-point
attributes
27. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
type coercion
register
assignment statement
pointer
28. A member function should be declared static if it does not access __________ class members.
non-static
function overloading
preprocessor
escape sequences
29. __________ can be used to assign an object of a class to another object of the same class.
Closing brace
char
polymorphism
Default memberwise assignment
30. Program components in C++ are called functions and ________.
new line
like-type expression
classes
type casting (conversion)
31. A function that can be used to read character data including whitespace
preprocessor
member
cin.get(ch)
fixed
32. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
classes
function overloading
inheritance
t
33. The ________ of an identifier is the portion of the program in which the identifier can be used.
base class
identifiers
assignment statement
scope
34. A function ________ enables a single function to be defined to perform a task on many different data types.
variable
searching
template
register
35. tab
cin.get(ch)
t
subscript (or index)
const
36. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
const
<<
function parameters
delete
37. The symbol for the binary scope resolution operator
return
data type
object file
::
38. 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.
pointer
default constructor
?
opened
39. * / % + -
Arithmetic Operators
special symbols
classes
const
40. The ________ program combines the output of the compiler with various library functions to produce an executable image.
binary operator
linker
reserved words
Semicolon
41. Every C++ statement ends with a(n) _________.
global
cin.get(ch)
cmath
semicolon
42. Names of things that are used in a program - can apply to variables & constants and functions
const
Preprocessor
&
identifiers
43. The _____ causes the contents of another file to be inserted into a program.
function scope
integer operands
default constructor
#include directive
44. The process of analyzing and designing a system from an object-oriented point of view is called ________.
Preprocessor
object-oriented analysis and design (OOAD)
preprocessor
derived class
45. In inheritance the ____________ is the class that supplies the inherited members.
special symbols
like-type expression
return
base class
46. A filestream variable that represents the default input source
identifiers
cin
integer operands
source file
47. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
left
semantics
type coercion
const
48. Function ________ is used to produce random numbers.
integer operands
fixed
token
rand
49. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
loader
char
strlen()
integer operands
50. You can declare default values for a function in the ____________________.
function parameters
strcmp()
friend
before