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 member function should be declared static if it does not access __________ class members.
if
non-static
semantics
virtual functions
2. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
#include
register
token
3. A sequence of operands and operators that describe a calculation to be performed
pointer
strcpy()
arithmetic expression
getline
4. Program components in C++ are called functions and ________.
classes
assignment statement
Unified Modeling Language(UML)
endl (same as 'n')
5. __________ can be used to assign an object of a class to another object of the same class.
//
identifiers
Default memberwise assignment
classes
6. 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.
Arithmetic Operators
object-oriented analysis and design (OOAD)
/n
t
7. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
#include <headerfilename>
Semicolon
private
showpoint
8. Used for dynamically allocated variables
floating-point
heap
<<
NULL
9. Operator with only one operand
escape sequences
binary operator
unary operator
void
10. All ______ must be declared before they are used.
constant variable
variables
derived class
base class
11. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
access specifier
strcpy()
recursive
register
12. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
?
cin
inline functions
ofstream
13. 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
variables
operator
default constructor
14. The _____ causes the contents of another file to be inserted into a program.
fstream
operand value
type
#include directive
15. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
floating-point
special symbols
const datatype identifier = value
16. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
Stack overflow
selection
floating-point
auto
17. The idea that you can call the same function and the output will depend on the type of object you're using.
if
polymorphism
#include <headerfilename>
reserve words
18. 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.
virtual functions
void
mixed expression
friend
19. Type casting syntax
delete
static_cast<char>(65)
#include directive
scope
20. A set of values together with a set of operations
<<
data type
getline
arithmetic expression
21. The modulus operator (%) can be used only with __________.
% modulus
static_cast<char>(65)
global
integer operands
22. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
mixed expression
cin >> variable
associations
definition
23. A human readable file that contains C++ program
arithmetic expression
source file
variable
scope
24. A function is invoked with a ________.
allocating memory
function call
if
constant variable
25. Associate an identifier with a memory location
allocating memory
continue
named constant
setw
26. The only integer that can be assigned directly to a pointer is_____________.
escape sequences
0
const datatype identifier = value
Arithmetic Operators
27. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
strcmp()
Semicolon
base
28. The size & shape & color and weight of an object are considered
return
t
attributes
strlen()
29. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
semantics
#include
Unified Modeling Language(UML)
variables
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
associations
return
base
source file
31. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
friend
data type
auto
32. Creates a copy of a string.
strcpy()
named constant
base
source file
33. This is used to mark the end of a complete C++ programming statement.
Semicolon
associations
Sentinel
function scope
34. Returns the length of a string excluding the null terminator.
strlen()
identifiers
static
selection
35. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
recursive
this
strcmp()
definition
36. The ________ program combines the output of the compiler with various library functions to produce an executable image.
register
base
linker
recursive function
37. A filestream variable that represents the default input source
object-oriented analysis and design (OOAD)
break
cin
recursive
38. Initializers __________ must be used to initialize constant members of a class.
member
&
operator overloading
selection
39. An expression that has operands with different data types
subscript (or index)
int values
assignment statement
mixed expression
40. The ________ qualifier is used to declare read-only variables.
cin
assignment statement
linker
const
41. A function ________ enables a single function to be defined to perform a task on many different data types.
scope
recursive
reserve words
template
42. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
data type
getline
unary operator
friend
43. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
globals
unary scope resolution operator (::)
Unified Modeling Language(UML)
assignment
44. Every C++ program begins execution at the function _________.
data type
non-static
main
polymorphism
45. Symbol that denotes an action to be performed
operator
vectors
void
const
46. An operator that can only be used with int values. result will always be an int.
t
% modulus
cout
const
47. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
strcpy()
global
named constant
char
48. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
classes
.cpp
editor
selection
49. 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.
static
operand value
int values
srand
50. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
loader
beginning
const
static