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. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
void
token
classes
?
2. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
function parameters
escape sequences
setw
//
3. 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.
linker
dot (.)
#include
?
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
special symbols
static
5. Allows the programmer to store a value in a variable
arithmetic expression
attributes
assignment statement
variables
6. A variable that holds the address of another variable.
base
fstream
before
pointer
7. This manipulator causes the field to be left-justified with padding spaces printed to the right.
this
left
information hiding
global
8. Nonexecutable statements that are included in a program to provide information about what the program does etc.
preprocessor
comments
inline functions
rand
9. A member function should be declared static if it does not access __________ class members.
overloading
if
data type
non-static
10. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
function scope
static
operator overloading
11. Associate an identifier with a memory location
before
subscript (or index)
Preprocessor
allocating memory
12. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
::
this
inheritance
preprocessor
13. The ________ of an identifier is the portion of the program in which the identifier can be used.
if...else
*
scope
function parameters
14. Repeating a set of instructions a specific number of times is called_________repetition.
template
beginning
mixed expression
Counter-controlled or definite
15. Function ________ is used to produce random numbers.
left
arithmetic expression
auto
rand
16. A variable declared outside any block or function is a ________ variable.
showpoint
assignment
static
global
17. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
18. All ______ must be declared before they are used.
variables
cin
inheritance
main
19. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
strlen()
binary operator
operator overloading
cmath
20. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
cin.get(ch)
information hiding
selection
break
21. A sequence of operands and operators that describe a calculation to be performed
two-dimensional
arithmetic expression
NULL
vectors
22. = & | are examples of ____________.
special symbols
function scope
scope
>>
23. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
const
default constructor
data type
24. A memory location with a name and data type - its content may be changed during program execution
variable
cmath
endl (same as 'n')
const datatype identifier = value
25. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
type
semantics
editor
strcmp()
26. 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
srand
reserved words
base
initialized
27. A function ________ enables a single function to be defined to perform a task on many different data types.
left
#include <headerfilename>
template
opened
28. An expression that has operands with different data types
n
&
mixed expression
% modulus
29. The idea that you can call the same function and the output will depend on the type of object you're using.
auto
identifiers
polymorphism
scope
30. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
switch
void
if...else
member
31. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
setw
allocating memory
auto
32. The _____ causes the contents of another file to be inserted into a program.
<<
base class
void
#include directive
33. Class members specified as _________ are accessible anywhere an object of the class is in scope.
strlen()
prompt
escape sequences
public
34. The process of analyzing and designing a system from an object-oriented point of view is called ________.
return
object-oriented analysis and design (OOAD)
before
floating-point
35. Message displayed to the screen asking user for input; generated with an output statement
const
Counter-controlled or definite
prompt
source file
36. The ________ statement in a called function passes the value of an expression back to the calling function.
cin
return
setw
{ }
37. 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.
derived class
virtual functions
preprocessor
?
38. Most calculations are normally performed by ______ statements.
non-static
const
assignment
binary operator
39. A constant object must be __________; it cannot be modified after it is created.
named constant
initialized
0
inheritance
40. The elements of an array are related by the fact that they have the same name and ___________.
type
heap
0
endl (same as 'n')
41. In inheritance the ____________ is the class the receives the inherited members.
comments
derived class
&
Sentinel
42. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
Sentinel
ofstream
showpoint
43. A type of pointer that can point at objects of any data type.
getline
auto
void pointer
syntax
44. The modulus operator (%) can be used only with __________.
integer operands
cin >> variable
/n
syntax
45. Executable version of program
address
new line
object file
operator overloading
46. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
recursive
private
default constructor
.cpp
47. An expression in which all operands have the same data type - result will have the same data type as operands
classes
cmath
function overloading
like-type expression
48. Initializers __________ must be used to initialize constant members of a class.
floating-point
global
mixed expression
member
49. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
setw
register
#include <headerfilename>
private
50. A filestream variable that represents the default output device
global
cout
cmath
recursive function