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. directive A statement that starts with a # is called a ____________.
rand
classes
definition
Preprocessor
2. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
cmath
return
register
operator overloading
3. Class members specified as _________ are accessible anywhere an object of the class is in scope.
friend
<<
non-static
public
4. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
const
strcpy()
>>
object-oriented analysis and design (OOAD)
5. In inheritance the ____________ is the class that supplies the inherited members.
register
return
base class
escape sequences
6. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
continue
new line
floating-point
pointer
7. 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
case sensitive
a.out
mixed expression
8. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
main
global
whitespace
9. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
inline functions
cout
#include
return
10. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
cin.get(ch)
return
local variable
11. To write data to a file you define an object of which one of the following
preprocessor
type
ofstream
t
12. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
const
if...else
pointer
binary operator
13. A filestream variable that represents the default output device
const
cout
break
#include directive
14. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.
loader
fstream
stack
?
15. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
base class
srand
two-dimensional
void
16. Used for dynamically allocated variables
heap
*
dot (.)
mixed expression
17. This is used to mark the end of a complete C++ programming statement.
#include
this
Semicolon
Closing brace
18. A set of values together with a set of operations
fstream
endl (same as 'n')
cin >> variable
data type
19. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
continue
new line
non-static
n
20. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
default constructor
cmath
if...else
n
21. A pointer is a variable that contains as its value the____________ of another variable.
address
preprocessor
allocating memory
whitespace
22. Executable version of program
cin
ofstream
strcmp()
object file
23. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
static
*
pointer
token
24. Naming convention for C++ programs
opened
?
.cpp
strcmp()
25. The three values that can be used to initialize a pointer are 0 - __________ and an address.
NULL
arithmetic expression
function prototype
sorting
26. Forces the computer to display decimal point and trailing zeroes
showpoint
function prototype
loader
operator
27. Repeating a set of instructions a specific number of times is called_________repetition.
pointer
Counter-controlled or definite
*
special symbols
28. The address-of operator. it is used to assign pointers and to print the address of variables.
pointer
case sensitive
&
void
29. Syntax for named constant declaration
const datatype identifier = value
whitespace
variable
cin
30. Sets floating-point values to a fixed decimal format
cin >> variable
Default memberwise assignment
fixed
constant variable
31. 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.
initialized
a.out
comments
inheritance
32. Type casting syntax
special symbols
static_cast<char>(65)
case sensitive
heap
33. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.
*
associations
if
dot (.)
34. You must have a ___________ for every variable you intend to use in a program
delete
definition
{ }
strlen()
35. A function that calls itself
::
recursive function
n
associations
36. = & | are examples of ____________.
Default memberwise assignment
if
#include
special symbols
37. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
derived class
beginning
case sensitive
38. The process of placing the elements of an array in order is called ________ the array.
local variable
sorting
loader
#include
39. A __________ data member represents class-wide information.
static
arithmetic expression
private
globals
40. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
searching
dot (.)
base class
globals
41. To explicitly indicate that a value is to be converted to another type
type coercion
type casting (conversion)
Semicolon
friend
42. int namespace include using return examples of ___________
heap
int values
if
reserve words
43. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
srand
special symbols
#include <headerfilename>
44. The sign you use for pointers
selection
arithmetic expression
/n
*
45. A ________ program executes before the compiler's translation phase begins.
preprocessor
char
void
definition
46. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
% modulus
data type
operator overloading
rand
47. The process of determining if an array contains a particular key value is called _________ the array.
searching
syntax
setw
vectors
48. A filestream variable that represents the default input source
like-type expression
address
cin
0
49. The _________ begins the body of every function and the _________ ends the body of every function.
derived class
&
{ }
ofstream
50. Program components in C++ are called functions and ________.
classes
pointer
cin >> variable
function overloading