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. To allow file access in a program you must #include this header file.
fstream
base class
operator
subscript (or index)
2. A human readable file that contains C++ program
virtual functions
unary operator
initialized
source file
3. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
&
strcmp()
Counter-controlled or definite
register
4. The stream insertion operator
data type
<<
const datatype identifier = value
prompt
5. This manipulator causes the field to be left-justified with padding spaces printed to the right.
#include
continue
n
left
6. A member function should be declared static if it does not access __________ class members.
strlen()
function call
Semicolon
non-static
7. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
whitespace
searching
editor
Unified Modeling Language(UML)
8. This manipulator is used to establish a field width for the value immediately following it.
setw
Unified Modeling Language(UML)
type
&
9. Creates a copy of a string.
strcpy()
pointer
setw
identifiers
10. 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
source file
if...else
base
variable
11. In inheritance the ____________ is the class that supplies the inherited members.
mixed expression
static
syntax
base class
12. newline
n
initialized
int values
type casting (conversion)
13. A file must be ________ before data can be written to or read from it.
token
cin
new line
opened
14. A memory location with a name and data type - its content may be changed during program execution
if
Literals
a.out
variable
15. Used to qualify hidden names so that they can be used.
Semicolon
subscript (or index)
linker
scope resolution operator
16. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
auto
loader
Counter-controlled or definite
Stack overflow
17. The modulus operator (%) can be used only with __________.
strcmp()
cin
register
integer operands
18. For every opening brace in a C++ program there must be a ______________.
source file
Closing brace
type coercion
register
19. You must have a ___________ for every variable you intend to use in a program
>>
Closing brace
definition
delete
20. The storage-class specifiers are mutable - auto - ________ - extern and static.
preprocessor
&
register
editor
21. These are data items whose values do not change while the program is running
/n
attributes
char
Literals
22. The only integer that can be assigned directly to a pointer is_____________.
whitespace
0
endl (same as 'n')
reserve words
23. Used for function calls and local variables
stack
attributes
private
selection
24. A ________ program executes before the compiler's translation phase begins.
binary operator
preprocessor
public
new line
25. A __________ data member represents class-wide information.
char
strlen()
selection
static
26. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
% modulus
source file
pointer
27. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
template
associations
return
28. Lists and tables of values can be stored in arrays or __________.
recursive
special symbols
vectors
Counter-controlled or definite
29. An operator that can only be used with int values. result will always be an int.
% modulus
main
sorting
continue
30. Message displayed to the screen asking user for input; generated with an output statement
if
this
prompt
const
31. int namespace include using return examples of ___________
object file
friend
reserve words
getline
32. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
binary operator
variable
initialized
33. An expression that has operands with different data types
t
case sensitive
mixed expression
binary operator
34. Every C++ statement ends with a(n) _________.
int values
return
cmath
semicolon
35. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
ofstream
type casting (conversion)
getline
static
36. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
Literals
semicolon
syntax
inline functions
37. * / % + -
heap
unary scope resolution operator (::)
allocating memory
Arithmetic Operators
38. The ________ program combines the output of the compiler with various library functions to produce an executable image.
strlen()
this
#include directive
linker
39. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
function overloading
assignment
*
const
40. A function is invoked with a ________.
{ }
function call
register
left
41. 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.
endl (same as 'n')
static
escape sequences
syntax
42. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
const
strcpy()
int values
43. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
int values
binary operator
const
return
44. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
preprocessor
friend
setw
mixed expression
45. Initializers __________ must be used to initialize constant members of a class.
heap
Unified Modeling Language(UML)
member
attributes
46. Most calculations are normally performed by ______ statements.
inheritance
loader
assignment
cout
47. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
NULL
base class
.cpp
recursive
48. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
initialized
type
scope
selection
49. Header file that contains commonly performed mathematical functions
?
cmath
const
initialized
50. directive A statement that starts with a # is called a ____________.
named constant
unary scope resolution operator (::)
operator
Preprocessor