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 ________ statement in a called function passes the value of an expression back to the calling function.
return
variables
*
function call
2. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
char
function overloading
unary scope resolution operator (::)
void pointer
3. Syntax for named constant declaration
inline functions
member
cout
const datatype identifier = value
4. Executable version of program
n
object file
special symbols
virtual functions
5. You must have a ___________ for every variable you intend to use in a program
this
subscript (or index)
syntax
definition
6. An operator that can only be used with int values. result will always be an int.
int values
delete
% modulus
Counter-controlled or definite
7. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
assignment
return
&
reserved words
8. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
pointer
pointer
default constructor
new line
9. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
continue
Literals
static
10. A sequence of operands and operators that describe a calculation to be performed
>>
arithmetic expression
a.out
like-type expression
11. An expression that has operands with different data types
main
mixed expression
#include <headerfilename>
sorting
12. This manipulator causes the field to be left-justified with padding spaces printed to the right.
reserved words
classes
Literals
left
13. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
static_cast<char>(65)
switch
classes
vectors
14. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
auto
const
floating-point
associations
15. The _____ causes the contents of another file to be inserted into a program.
static
operator
function overloading
#include directive
16. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
classes
type
pointer
17. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
% modulus
private
data type
18. Words that are used for special purposes in a program
reserved words
recursive
globals
assignment statement
19. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
continue
binary operator
variable
friend
20. 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.
void pointer
rand
operand value
static
21. Type casting syntax
variable
static_cast<char>(65)
inheritance
main
22. A file must be ________ before data can be written to or read from it.
opened
linker
{ }
type
23. Function ________ is used to produce random numbers.
fixed
type casting (conversion)
rand
prompt
24. In inheritance the ____________ is the class that supplies the inherited members.
base class
template
int values
function call
25. The only integer that can be assigned directly to a pointer is_____________.
strlen()
prompt
0
operand value
26. int namespace include using return examples of ___________
const
reserve words
strcmp()
recursive
27. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
#include <headerfilename>
scope resolution operator
pointer
28. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
derived class
0
recursive
endl (same as 'n')
29. Used for function calls and local variables
variable
if...else
new line
stack
30. The address-of operator. it is used to assign pointers and to print the address of variables.
scope
function parameters
&
function call
31. Grammar rules of the language; compiler will try to identify and locate syntax errors
information hiding
function overloading
syntax
allocating memory
32. A type of pointer that can point at objects of any data type.
*
data type
non-static
void pointer
33. 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
base
Closing brace
type
strcpy()
34. Repeating a set of instructions a specific number of times is called_________repetition.
reserved words
this
linker
Counter-controlled or definite
35. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
named constant
beginning
classes
::
36. Every C++ program begins execution at the function _________.
subscript (or index)
main
0
ofstream
37. Most calculations are normally performed by ______ statements.
private
non-static
Default memberwise assignment
assignment
38. 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
Semicolon
overloading
new line
39. Two slash marks ( // ) indicate __________ of a comment
*
initialized
Semicolon
beginning
40. The modulus operator (%) can be used only with __________.
integer operands
function scope
srand
initialized
41. A memory location with a name and data type - its content may be changed during program execution
named constant
type
address
variable
42. The ________ qualifier is used to declare read-only variables.
type casting (conversion)
const
#include
prompt
43. A filestream variable that represents the default output device
cout
srand
% modulus
auto
44. Class members specified as _________ are accessible anywhere an object of the class is in scope.
linker
editor
object-oriented analysis and design (OOAD)
public
45. Initializers __________ must be used to initialize constant members of a class.
recursive function
static_cast<char>(65)
information hiding
member
46. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
comments
classes
#include
like-type expression
47. 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
template
opened
reserved words
48. Lists and tables of values can be stored in arrays or __________.
pointer
heap
base
vectors
49. A __________ should be used to declare the size of an array because it makes the program more scalable.
Preprocessor
variables
constant variable
void
50. For every opening brace in a C++ program there must be a ______________.
identifiers
t
Closing brace
::