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. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
getline
named constant
assignment statement
assignment
2. All C++ Variables are_________.
case sensitive
return
token
Semicolon
3. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
loader
preprocessor
classes
4. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
prompt
recursive
switch
&
5. __________ can be used to assign an object of a class to another object of the same class.
dot (.)
cin.get(ch)
Default memberwise assignment
static_cast<char>(65)
6. Whole numbers - no decimals and no commas included
Literals
Semicolon
<<
int values
7. The address-of operator. it is used to assign pointers and to print the address of variables.
&
allocating memory
ofstream
% modulus
8. A function that can be used to read character data including whitespace
if
cin.get(ch)
virtual functions
prompt
9. Creates a copy of a string.
base
strcpy()
if...else
local variable
10. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
dot (.)
private
stack
return
11. newline
switch
n
#include <headerfilename>
polymorphism
12. Words that are used for special purposes in a program
linker
object-oriented analysis and design (OOAD)
cin >> variable
reserved words
13. Identifier or expression that is part of the calculation to be performed
object-oriented analysis and design (OOAD)
endl (same as 'n')
non-static
operand value
14. Symbol that denotes an action to be performed
char
this
operator
Sentinel
15. A filestream variable that represents the default input source
function scope
//
const datatype identifier = value
cin
16. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
associations
token
pointer
selection
17. A function that calls itself
prompt
recursive function
linker
constant variable
18. 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.
<<
scope
virtual functions
allocating memory
19. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
cout
auto
::
static
20. Used for function calls and local variables
left
subscript (or index)
stack
register
21. The modulus operator (%) can be used only with __________.
#include
function parameters
integer operands
delete
22. A memory location with a name and data type - its content may be changed during program execution
base class
variable
function overloading
const
23. 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.
special symbols
return
static
type
24. Used to qualify hidden names so that they can be used.
Stack overflow
scope resolution operator
static
t
25. The stream extraction operator
% modulus
cmath
base class
>>
26. Use 2 characters to represent one
function prototype
type
floating-point
escape sequences
27. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
cin
inline functions
sorting
variables
28. Grammar rules of the language; compiler will try to identify and locate syntax errors
register
Closing brace
syntax
cmath
29. To write data to a file you define an object of which one of the following
::
strlen()
ofstream
special symbols
30. The three values that can be used to initialize a pointer are 0 - __________ and an address.
Literals
integer operands
setw
NULL
31. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
semicolon
editor
binary operator
32. The _____ causes the contents of another file to be inserted into a program.
constant variable
vectors
operand value
#include directive
33. 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.
dot (.)
cin >> variable
stack
information hiding
34. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
showpoint
//
function overloading
break
35. The ________ statement in a called function passes the value of an expression back to the calling function.
int values
return
Closing brace
cin.get(ch)
36. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
if...else
continue
const
stack
37. Preprocessor directive syntax
editor
information hiding
fstream
#include <headerfilename>
38. A __________ should be used to declare the size of an array because it makes the program more scalable.
access specifier
constant variable
pointer
static_cast<char>(65)
39. Names of things that are used in a program - can apply to variables & constants and functions
identifiers
//
break
searching
40. For every opening brace in a C++ program there must be a ______________.
comments
heap
register
Closing brace
41. A human readable file that contains C++ program
void pointer
Counter-controlled or definite
source file
const datatype identifier = value
42. To explicitly indicate that a value is to be converted to another type
recursive function
const datatype identifier = value
type casting (conversion)
polymorphism
43. If a member initializer is not provided for a member object of a class the object's __________ is called.
default constructor
loader
static_cast<char>(65)
void pointer
44. 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.
strcmp()
friend
void
recursive
45. * / % + -
operator overloading
access specifier
Arithmetic Operators
information hiding
46. Allows the programmer to store a value in a variable
return
inheritance
assignment statement
operator
47. The __________ operator reclaims memory previously allocated by new.
whitespace
delete
fstream
type casting (conversion)
48. Member objects are constructed __________ their enclosing class object.
loader
?
before
function overloading
49. 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.
non-static
function parameters
delete
?
50. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
*
global
&
function prototype