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 storage-class specifiers are mutable - auto - ________ - extern and static.
register
switch
globals
polymorphism
2. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
token
rand
auto
globals
3. An expression in which all operands have the same data type - result will have the same data type as operands
static
overloading
like-type expression
t
4. The modulus operator (%) can be used only with __________.
if...else
Default memberwise assignment
#include directive
integer operands
5. Grammar rules of the language; compiler will try to identify and locate syntax errors
assignment
Arithmetic Operators
NULL
syntax
6. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
Closing brace
register
source file
local variable
7. The ________ of an identifier is the portion of the program in which the identifier can be used.
const datatype identifier = value
0
scope
local variable
8. Whole numbers - no decimals and no commas included
% modulus
operator
return
int values
9. The _____ causes the contents of another file to be inserted into a program.
base
#include directive
inheritance
object file
10. Words that are used for special purposes in a program
reserved words
token
setw
classes
11. The symbol for the binary scope resolution operator
mixed expression
before
polymorphism
::
12. Syntax for named constant declaration
identifiers
register
const datatype identifier = value
operand value
13. A pointer is a variable that contains as its value the____________ of another variable.
getline
information hiding
address
opened
14. To write data to a file you define an object of which one of the following
ofstream
semicolon
preprocessor
loader
15. All ______ must be declared before they are used.
Default memberwise assignment
searching
Counter-controlled or definite
variables
16. Most calculations are normally performed by ______ statements.
data type
assignment
cin >> variable
fixed
17. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
Arithmetic Operators
void pointer
main
Stack overflow
18. A filestream variable that represents the default output device
::
source file
cout
NULL
19. Forces the computer to display decimal point and trailing zeroes
default constructor
showpoint
object file
definition
20. Returns the length of a string excluding the null terminator.
preprocessor
t
local variable
strlen()
21. Initializers __________ must be used to initialize constant members of a class.
allocating memory
attributes
member
default constructor
22. A memory location with a name and data type - its content may be changed during program execution
scope
{ }
variable
fstream
23. 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.
Default memberwise assignment
Literals
Sentinel
binary operator
24. Characters used to separate symbols or reserved words or identifiers and statements
type coercion
scope resolution operator
Arithmetic Operators
whitespace
25. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
void
virtual functions
operator overloading
//
26. The elements of an array are related by the fact that they have the same name and ___________.
type
vectors
mixed expression
special symbols
27. An expression that has operands with different data types
mixed expression
#include directive
?
fstream
28. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
address
virtual functions
inline functions
unary operator
29. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
endl (same as 'n')
whitespace
case sensitive
char
30. These are data items whose values do not change while the program is running
Literals
srand
arithmetic expression
private
31. To allow file access in a program you must #include this header file.
fstream
function prototype
type coercion
recursive
32. The ________ program transfers the executable image of a C++ program from disk to memory.
getline
loader
ofstream
prompt
33. The stream insertion operator
non-static
cin
base
<<
34. 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
cmath
::
recursive
35. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
friend
NULL
unary operator
36. A sequence of operands and operators that describe a calculation to be performed
arithmetic expression
left
unary operator
getline
37. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
scope resolution operator
private
attributes
scope
38. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
const
break
sorting
integer operands
39. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
t
getline
void
overloading
40. Executable version of program
object file
polymorphism
two-dimensional
mixed expression
41. Allows the programmer to store a value in a variable
<<
assignment statement
classes
scope resolution operator
42. Function ________ is used to set the random number seed to randomize a program.
&
static
Default memberwise assignment
srand
43. int namespace include using return examples of ___________
t
cout
mixed expression
reserve words
44. Class members specified as _________ are accessible anywhere an object of the class is in scope.
attributes
return
endl (same as 'n')
public
45. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
type
assignment statement
opened
cin >> variable
46. An operator that can only be used with int values. result will always be an int.
% modulus
cin >> variable
case sensitive
pointer
47. newline
sorting
source file
assignment
n
48. A function ________ enables a single function to be defined to perform a task on many different data types.
Default memberwise assignment
template
auto
>>
49. 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.
function scope
source file
static
switch
50. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
integer operands
strcmp()
setw