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. Whole numbers - no decimals and no commas included
int values
attributes
arithmetic expression
non-static
2. = & | are examples of ____________.
special symbols
member
0
Stack overflow
3. The symbol for the binary scope resolution operator
::
cin >> variable
private
*
4. The ________ program combines the output of the compiler with various library functions to produce an executable image.
return
linker
strlen()
polymorphism
5. Nonexecutable statements that are included in a program to provide information about what the program does etc.
function scope
case sensitive
srand
comments
6. Words that are used for special purposes in a program
cin.get(ch)
reserved words
fstream
polymorphism
7. The _________ begins the body of every function and the _________ ends the body of every function.
operator overloading
endl (same as 'n')
type
{ }
8. A constant object must be __________; it cannot be modified after it is created.
initialized
ofstream
Unified Modeling Language(UML)
prompt
9. A file must be ________ before data can be written to or read from it.
Preprocessor
operator overloading
opened
initialized
10. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
recursive function
continue
classes
inline functions
11. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
classes
auto
default constructor
cin >> variable
12. Message displayed to the screen asking user for input; generated with an output statement
data type
function scope
prompt
Closing brace
13. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
vectors
type casting (conversion)
?
14. A __________ data member represents class-wide information.
left
escape sequences
new line
static
15. data types that refer to numbers with decimals
floating-point
sorting
named constant
type
16. A sequence of operands and operators that describe a calculation to be performed
object file
arithmetic expression
rand
associations
17. A variable that is known only within the function in which it is defined is called a ________.
local variable
named constant
variables
access specifier
18. A ________ program executes before the compiler's translation phase begins.
arithmetic expression
editor
a.out
preprocessor
19. The three values that can be used to initialize a pointer are 0 - __________ and an address.
return
polymorphism
NULL
token
20. int namespace include using return examples of ___________
NULL
reserve words
Preprocessor
*
21. All ______ must be declared before they are used.
#include <headerfilename>
variables
reserve words
preprocessor
22. Preprocessor directive syntax
main
sorting
inheritance
#include <headerfilename>
23. An expression that has operands with different data types
return
operator
mixed expression
preprocessor
24. 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.
classes
information hiding
reserved words
auto
25. Associate an identifier with a memory location
% modulus
classes
allocating memory
integer operands
26. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
static
template
register
reserved words
27. The only integer that can be assigned directly to a pointer is_____________.
constant variable
recursive function
/n
0
28. The ________ of an identifier is the portion of the program in which the identifier can be used.
static_cast<char>(65)
scope
virtual functions
continue
29. Every C++ program begins execution at the function _________.
.cpp
/n
beginning
main
30. Function ________ is used to set the random number seed to randomize a program.
//
setw
int values
srand
31. A memory location with a name and data type - its content may be changed during program execution
ofstream
*
variable
rand
32. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
new line
classes
auto
attributes
33. A type of pointer that can point at objects of any data type.
srand
void pointer
information hiding
#include directive
34. Header file that contains commonly performed mathematical functions
cmath
access specifier
beginning
arithmetic expression
35. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
whitespace
cout
//
binary operator
36. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
Unified Modeling Language(UML)
prompt
cout
this
37. Allows the programmer to store a value in a variable
operator
globals
assignment statement
token
38. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
ofstream
sorting
object file
selection
39. Operator with two operands
ofstream
associations
binary operator
inheritance
40. The modulus operator (%) can be used only with __________.
object file
integer operands
Stack overflow
const
41. Compares two strings and returns 0 if they are equal.
strcmp()
attributes
base class
variable
42. Used to qualify hidden names so that they can be used.
#include directive
scope resolution operator
new line
int values
43. Initializers __________ must be used to initialize constant members of a class.
global
cin.get(ch)
virtual functions
member
44. Most calculations are normally performed by ______ statements.
whitespace
assignment
?
default constructor
45. 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
variable
cout
46. A filestream variable that represents the default input source
Sentinel
0
unary scope resolution operator (::)
cin
47. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
globals
.cpp
member
48. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
constant variable
default constructor
function scope
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.
rand
syntax
0
static
50. A function that calls itself
recursive function
Preprocessor
static
syntax