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. __________ can be used to assign an object of a class to another object of the same class.
attributes
Default memberwise assignment
unary operator
#include
2. For every opening brace in a C++ program there must be a ______________.
Closing brace
const
scope resolution operator
register
3. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
cin.get(ch)
inheritance
derived class
4. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
void
//
operator
&
5. This manipulator is used to establish a field width for the value immediately following it.
binary operator
setw
#include directive
unary scope resolution operator (::)
6. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
operator
getline
setw
7. Naming convention for C++ programs
default constructor
dot (.)
unary scope resolution operator (::)
.cpp
8. 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.
globals
information hiding
a.out
local variable
9. Used to qualify hidden names so that they can be used.
variable
fixed
scope resolution operator
token
10. Every C++ program begins execution at the function _________.
srand
static
#include
main
11. Identifier or expression that is part of the calculation to be performed
operand value
inline functions
cin
char
12. Function ________ is used to produce random numbers.
rand
globals
constant variable
recursive
13. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
semicolon
cin >> variable
heap
selection
14. Associate an identifier with a memory location
allocating memory
this
return
Literals
15. The size & shape & color and weight of an object are considered
attributes
escape sequences
preprocessor
assignment statement
16. A variable that is known only within the function in which it is defined is called a ________.
local variable
function scope
register
reserved words
17. 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.
subscript (or index)
/n
overloading
special symbols
18. = & | are examples of ____________.
special symbols
dot (.)
overloading
break
19. A human readable file that contains C++ program
source file
Closing brace
cin
type
20. The _________ begins the body of every function and the _________ ends the body of every function.
endl (same as 'n')
{ }
comments
#include
21. Returns the length of a string excluding the null terminator.
strlen()
unary operator
globals
type
22. Use 2 characters to represent one
escape sequences
Counter-controlled or definite
variables
overloading
23. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
&
% modulus
operand value
24. directive A statement that starts with a # is called a ____________.
n
Preprocessor
*
fstream
25. Compares two strings and returns 0 if they are equal.
strcmp()
function overloading
delete
operator
26. 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.
*
virtual functions
register
#include <headerfilename>
27. The stream extraction operator
strlen()
>>
if
polymorphism
28. Member objects are constructed __________ their enclosing class object.
/n
register
before
left
29. The idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
token
subscript (or index)
type casting (conversion)
30. All C++ Variables are_________.
NULL
case sensitive
binary operator
/n
31. A ________ program executes before the compiler's translation phase begins.
vectors
preprocessor
cmath
case sensitive
32. A variable that holds the address of another variable.
setw
scope resolution operator
pointer
strcpy()
33. A C++ statement that makes a decision is ______.
if
<<
local variable
type
34. 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.
data type
globals
reserve words
?
35. A function is invoked with a ________.
classes
setw
function call
% modulus
36. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
Default memberwise assignment
srand
definition
37. The symbol for the binary scope resolution operator
semantics
::
const
void pointer
38. The __________ operator reclaims memory previously allocated by new.
>>
reserved words
delete
//
39. The modulus operator (%) can be used only with __________.
assignment
default constructor
integer operands
*
40. The ________ program combines the output of the compiler with various library functions to produce an executable image.
default constructor
pointer
linker
void pointer
41. An array that uses two subscripts is referred to as a(n) _________ array.
opened
two-dimensional
Default memberwise assignment
subscript (or index)
42. Initializers __________ must be used to initialize constant members of a class.
information hiding
#include
void
member
43. The address-of operator. it is used to assign pointers and to print the address of variables.
definition
&
Unified Modeling Language(UML)
NULL
44. 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.
friend
dot (.)
address
int values
45. Syntax for named constant declaration
definition
void
scope
const datatype identifier = value
46. The sign you use for pointers
global
private
*
vectors
47. Type casting syntax
{ }
recursive
assignment statement
static_cast<char>(65)
48. 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
49. Preprocessor directive syntax
#include <headerfilename>
function prototype
default constructor
sorting
50. Used for function calls and local variables
local variable
stack
template
this