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 four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
local variable
like-type expression
continue
globals
2. data types that refer to numbers with decimals
cin.get(ch)
Stack overflow
floating-point
Preprocessor
3. The ________ enables access to a global variable with the same name as a variable in the current scope.
classes
unary scope resolution operator (::)
function overloading
setw
4. 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.
preprocessor
/n
unary scope resolution operator (::)
non-static
5. The stream insertion operator
<<
/n
unary scope resolution operator (::)
selection
6. Repeating a set of instructions a specific number of times is called_________repetition.
selection
% modulus
Counter-controlled or definite
return
7. The elements of an array are related by the fact that they have the same name and ___________.
type
mixed expression
Arithmetic Operators
special symbols
8. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
sorting
dot (.)
private
9. You must have a ___________ for every variable you intend to use in a program
definition
polymorphism
Literals
two-dimensional
10. Allows the programmer to store a value in a variable
cin.get(ch)
assignment statement
classes
operator overloading
11. Classes can have relationships with other classes. These relationships are called ________.
Stack overflow
escape sequences
associations
strcmp()
12. Two slash marks ( // ) indicate __________ of a comment
stack
beginning
t
definition
13. A ________ program executes before the compiler's translation phase begins.
named constant
preprocessor
Stack overflow
inline functions
14. Initializers __________ must be used to initialize constant members of a class.
member
scope
function scope
void pointer
15. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
named constant
associations
overloading
16. The only integer that can be assigned directly to a pointer is_____________.
#include <headerfilename>
function call
cin.get(ch)
0
17. Associate an identifier with a memory location
auto
allocating memory
access specifier
template
18. The ________ statement in a called function passes the value of an expression back to the calling function.
0
*
operator overloading
return
19. This is used to mark the end of a complete C++ programming statement.
&
template
Semicolon
Stack overflow
20. 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.
void pointer
before
continue
token
21. A __________ data member represents class-wide information.
function call
if...else
static
NULL
22. * / % + -
Arithmetic Operators
cout
beginning
preprocessor
23. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
initialized
comments
cin >> variable
variable
24. Grammar rules of the language; compiler will try to identify and locate syntax errors
Stack overflow
syntax
whitespace
void
25. Lists and tables of values can be stored in arrays or __________.
type casting (conversion)
vectors
*
default constructor
26. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
new line
switch
setw
endl (same as 'n')
27. A C++ statement that makes a decision is ______.
base class
function prototype
if
subscript (or index)
28. All ______ must be declared before they are used.
<<
char
static
variables
29. Function ________ is used to produce random numbers.
rand
Default memberwise assignment
overloading
#include directive
30. A set of values together with a set of operations
data type
pointer
Default memberwise assignment
access specifier
31. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
a.out
function overloading
const
const
32. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
return
address
char
dot (.)
33. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
Closing brace
void
access specifier
token
34. A filestream variable that represents the default input source
cin
Arithmetic Operators
this
function prototype
35. Most calculations are normally performed by ______ statements.
assignment
Semicolon
void
function scope
36. To allow file access in a program you must #include this header file.
fstream
Semicolon
special symbols
base
37. 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.
register
integer operands
switch
static
38. = & | are examples of ____________.
integer operands
special symbols
/n
attributes
39. The sign you use for pointers
#include directive
*
derived class
inheritance
40. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
globals
variables
static
41. 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
fstream
>>
base
function scope
42. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
if
local variable
return
scope
43. An operator that can only be used with int values. result will always be an int.
NULL
strcpy()
% modulus
endl (same as 'n')
44. Header file that contains commonly performed mathematical functions
address
cmath
Stack overflow
local variable
45. Use 2 characters to represent one
Semicolon
selection
t
escape sequences
46. Forces the computer to display decimal point and trailing zeroes
static
comments
showpoint
switch
47. 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.
base
opened
operator
?
48. The _____ causes the contents of another file to be inserted into a program.
#include directive
definition
NULL
this
49. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
whitespace
getline
const datatype identifier = value
strlen()
50. The ________ program transfers the executable image of a C++ program from disk to memory.
Closing brace
void pointer
vectors
loader