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. An operator that can only be used with int values. result will always be an int.
polymorphism
% modulus
before
function call
2. The stream extraction operator
subscript (or index)
selection
void pointer
>>
3. Associate an identifier with a memory location
allocating memory
cin >> variable
main
source file
4. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
Stack overflow
new line
variable
void pointer
5. int namespace include using return examples of ___________
unary scope resolution operator (::)
reserve words
information hiding
vectors
6. Symbol that denotes an action to be performed
default constructor
return
new line
operator
7. Characters used to separate symbols or reserved words or identifiers and statements
void
whitespace
definition
default constructor
8. Used for dynamically allocated variables
heap
searching
//
mixed expression
9. When a value of one data type is implicitly (automatically) changed to another data type
continue
prompt
type coercion
function parameters
10. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
cin
this
return
function scope
11. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
assignment statement
/n
::
12. The ________ program combines the output of the compiler with various library functions to produce an executable image.
recursive function
linker
whitespace
preprocessor
13. In inheritance the ____________ is the class that supplies the inherited members.
base class
Arithmetic Operators
case sensitive
like-type expression
14. The elements of an array are related by the fact that they have the same name and ___________.
type
cin >> variable
pointer
function scope
15. = & | are examples of ____________.
cout
virtual functions
special symbols
private
16. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
Preprocessor
break
overloading
case sensitive
17. The address-of operator. it is used to assign pointers and to print the address of variables.
opened
&
syntax
operator
18. Nonexecutable statements that are included in a program to provide information about what the program does etc.
globals
//
cin
comments
19. Two slash marks ( // ) indicate __________ of a comment
editor
virtual functions
?
beginning
20. A variable declared outside any block or function is a ________ variable.
global
virtual functions
assignment statement
globals
21. This manipulator causes the field to be left-justified with padding spaces printed to the right.
a.out
reserve words
left
preprocessor
22. Used to qualify hidden names so that they can be used.
scope resolution operator
const
return
Arithmetic Operators
23. 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
base
Stack overflow
preprocessor
Preprocessor
24. All ______ must be declared before they are used.
variables
polymorphism
recursive
stack
25. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
mixed expression
opened
selection
function scope
26. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
/n
const
cin
27. C++ programs are normally typed into a computer using a(n) ________ program.
identifiers
editor
source file
ofstream
28. Preprocessor directive syntax
getline
mixed expression
access specifier
#include <headerfilename>
29. Forces the computer to display decimal point and trailing zeroes
continue
function overloading
showpoint
//
30. In inheritance the ____________ is the class the receives the inherited members.
derived class
static
globals
global
31. The ________ of an identifier is the portion of the program in which the identifier can be used.
allocating memory
base
scope
main
32. directive A statement that starts with a # is called a ____________.
Preprocessor
NULL
function overloading
whitespace
33. To allow file access in a program you must #include this header file.
Unified Modeling Language(UML)
allocating memory
loader
fstream
34. Type casting syntax
assignment statement
Preprocessor
token
static_cast<char>(65)
35. The size & shape & color and weight of an object are considered
Unified Modeling Language(UML)
attributes
*
cin
36. Class members specified as _________ are accessible anywhere an object of the class is in scope.
#include
member
public
semantics
37. Lists and tables of values can be stored in arrays or __________.
vectors
function scope
constant variable
strlen()
38. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
default constructor
vectors
getline
#include
39. An expression in which all operands have the same data type - result will have the same data type as operands
reserve words
Unified Modeling Language(UML)
like-type expression
source file
40. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
auto
register
unary operator
const datatype identifier = value
41. The ________ qualifier is used to declare read-only variables.
return
auto
/n
const
42. All C++ Variables are_________.
inline functions
type casting (conversion)
non-static
case sensitive
43. A file must be ________ before data can be written to or read from it.
special symbols
&
opened
private
44. Classes can have relationships with other classes. These relationships are called ________.
Preprocessor
Closing brace
associations
recursive
45. Names of things that are used in a program - can apply to variables & constants and functions
identifiers
#include <headerfilename>
editor
switch
46. A filestream variable that represents the default output device
ofstream
setw
cout
prompt
47. Initializers __________ must be used to initialize constant members of a class.
opened
derived class
member
showpoint
48. A program that finds and attaches to your program the indicated libraries for compilation
classes
fstream
Literals
preprocessor
49. Keyword public is a(n) _________
information hiding
access specifier
cin >> variable
#include <headerfilename>
50. Function ________ is used to produce random numbers.
selection
fixed
break
rand