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. Function ________ is used to produce random numbers.
subscript (or index)
unary operator
inheritance
rand
2. 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.
Semicolon
pointer
identifiers
static
3. This manipulator is used to establish a field width for the value immediately following it.
new line
setw
recursive function
binary operator
4. The storage-class specifiers are mutable - auto - ________ - extern and static.
Stack overflow
register
variables
return
5. A variable that holds the address of another variable.
recursive function
constant variable
default constructor
pointer
6. Compares two strings and returns 0 if they are equal.
strcmp()
Counter-controlled or definite
type coercion
inheritance
7. Most calculations are normally performed by ______ statements.
switch
assignment
unary operator
unary scope resolution operator (::)
8. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
token
pointer
scope
strlen()
9. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
member
overloading
beginning
classes
10. A human readable file that contains C++ program
vectors
global
case sensitive
source file
11. Characters used to separate symbols or reserved words or identifiers and statements
globals
whitespace
const
cmath
12. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
13. Names of things that are used in a program - can apply to variables & constants and functions
identifiers
const
classes
srand
14. The idea that you can call the same function and the output will depend on the type of object you're using.
const
#include
polymorphism
cin.get(ch)
15. Use 2 characters to represent one
const datatype identifier = value
escape sequences
object file
globals
16. The ________ program transfers the executable image of a C++ program from disk to memory.
function prototype
base
loader
n
17. Every C++ statement ends with a(n) _________.
main
semicolon
public
function scope
18. A filestream variable that represents the default input source
const datatype identifier = value
operand value
stack
cin
19. Nonexecutable statements that are included in a program to provide information about what the program does etc.
this
showpoint
comments
setw
20. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
base class
variables
char
Default memberwise assignment
21. Allows the programmer to store a value in a variable
register
assignment statement
constant variable
recursive
22. Creates a copy of a string.
classes
strcpy()
token
definition
23. A variable declared outside any block or function is a ________ variable.
<<
dot (.)
void pointer
global
24. Grammar rules of the language; compiler will try to identify and locate syntax errors
const
fixed
syntax
getline
25. A function ________ enables a single function to be defined to perform a task on many different data types.
allocating memory
associations
scope resolution operator
template
26. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
endl (same as 'n')
function call
main
#include
27. A set of values together with a set of operations
selection
recursive
unary scope resolution operator (::)
data type
28. newline
type coercion
n
t
scope resolution operator
29. 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.
special symbols
#include directive
inheritance
pointer
30. 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.
type coercion
heap
void
{ }
31. In inheritance the ____________ is the class that supplies the inherited members.
base class
beginning
preprocessor
two-dimensional
32. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
beginning
operand value
getline
void
33. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
const
srand
strcpy()
type coercion
34. * / % + -
/n
function scope
void pointer
Arithmetic Operators
35. Preprocessor directive syntax
t
non-static
identifiers
#include <headerfilename>
36. A sequence of operands and operators that describe a calculation to be performed
pointer
char
arithmetic expression
operator overloading
37. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.
a.out
classes
Sentinel
Closing brace
38. Member objects are constructed __________ their enclosing class object.
before
fstream
type casting (conversion)
object file
39. Every C++ program begins execution at the function _________.
non-static
main
base
function call
40. A type of pointer that can point at objects of any data type.
{ }
void pointer
strcpy()
semicolon
41. If a member initializer is not provided for a member object of a class the object's __________ is called.
assignment
default constructor
named constant
token
42. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
cin
dot (.)
srand
selection
43. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
base
cin >> variable
Preprocessor
44. An expression that has operands with different data types
mixed expression
new line
derived class
access specifier
45. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
{ }
strcmp()
cin
this
46. Message displayed to the screen asking user for input; generated with an output statement
reserve words
const
non-static
prompt
47. Classes can have relationships with other classes. These relationships are called ________.
{ }
a.out
special symbols
associations
48. A ________ program executes before the compiler's translation phase begins.
static
before
void
preprocessor
49. This is used to mark the end of a complete C++ programming statement.
Semicolon
strcpy()
void
if...else
50. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
operand value
switch
#include directive
syntax