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 ________ program executes before the compiler's translation phase begins.
>>
classes
preprocessor
this
2. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
left
Unified Modeling Language(UML)
classes
switch
3. Characters used to separate symbols or reserved words or identifiers and statements
prompt
const datatype identifier = value
delete
whitespace
4. directive A statement that starts with a # is called a ____________.
cin >> variable
definition
Preprocessor
srand
5. tab
identifiers
t
static
scope resolution operator
6. A function is invoked with a ________.
function call
loader
Literals
case sensitive
7. The ________ program combines the output of the compiler with various library functions to produce an executable image.
linker
<<
global
{ }
8. Symbol that denotes an action to be performed
type casting (conversion)
function parameters
case sensitive
operator
9. Forces the computer to display decimal point and trailing zeroes
constant variable
const datatype identifier = value
showpoint
escape sequences
10. Repeating a set of instructions a specific number of times is called_________repetition.
recursive function
linker
Counter-controlled or definite
register
11. These are data items whose values do not change while the program is running
stack
reserve words
srand
Literals
12. 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
int values
fixed
preprocessor
13. The symbol for the binary scope resolution operator
global
::
return
getline
14. A __________ data member represents class-wide information.
attributes
access specifier
classes
static
15. Nonexecutable statements that are included in a program to provide information about what the program does etc.
binary operator
cout
Literals
comments
16. A filestream variable that represents the default input source
cin
static
#include
special symbols
17. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
srand
semantics
strcpy()
Stack overflow
18. The elements of an array are related by the fact that they have the same name and ___________.
base
Arithmetic Operators
type
selection
19. Header file that contains commonly performed mathematical functions
scope
information hiding
cmath
special symbols
20. 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.
static
void
information hiding
recursive function
21. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
selection
srand
globals
setw
22. Names of things that are used in a program - can apply to variables & constants and functions
identifiers
delete
loader
if
23. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
assignment statement
comments
named constant
cmath
24. Every C++ statement ends with a(n) _________.
Closing brace
% modulus
semicolon
type coercion
25. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
before
searching
operand value
selection
26. Naming convention for C++ programs
associations
.cpp
template
constant variable
27. Used for function calls and local variables
stack
#include <headerfilename>
comments
object file
28. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
switch
binary operator
function parameters
29. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
whitespace
recursive
constant variable
base
30. A memory location with a name and data type - its content may be changed during program execution
function scope
arithmetic expression
address
variable
31. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
pointer
inline functions
switch
{ }
32. Creates a copy of a string.
break
variable
strcpy()
floating-point
33. The sign you use for references
comments
default constructor
&
void
34. Member objects are constructed __________ their enclosing class object.
before
scope resolution operator
inheritance
#include <headerfilename>
35. Syntax for named constant declaration
virtual functions
floating-point
const datatype identifier = value
return
36. A program that finds and attaches to your program the indicated libraries for compilation
Counter-controlled or definite
classes
main
preprocessor
37. An operator that can only be used with int values. result will always be an int.
Closing brace
% modulus
inline functions
recursive function
38. You must have a ___________ for every variable you intend to use in a program
#include directive
&
definition
void
39. Function ________ is used to set the random number seed to randomize a program.
char
srand
integer operands
data type
40. All ______ must be declared before they are used.
friend
variables
//
pointer
41. The three values that can be used to initialize a pointer are 0 - __________ and an address.
function parameters
continue
strcpy()
NULL
42. The ________ program transfers the executable image of a C++ program from disk to memory.
recursive function
friend
prompt
loader
43. The sign you use for pointers
virtual functions
*
Semicolon
beginning
44. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
token
strcpy()
n
getline
45. A function ________ enables a single function to be defined to perform a task on many different data types.
template
srand
function parameters
register
46. Default name of executable file
function scope
*
dot (.)
a.out
47. This is used to mark the end of a complete C++ programming statement.
Sentinel
#include <headerfilename>
Semicolon
const
48. Associate an identifier with a memory location
delete
ofstream
allocating memory
friend
49. The only integer that can be assigned directly to a pointer is_____________.
pointer
break
/n
0
50. The storage-class specifiers are mutable - auto - ________ - extern and static.
unary operator
cin >> variable
access specifier
register