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. Syntax for named constant declaration
friend
ofstream
return
const datatype identifier = value
2. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
associations
operator overloading
pointer
global
3. Preprocessor directive syntax
opened
left
ofstream
#include <headerfilename>
4. Whole numbers - no decimals and no commas included
recursive function
prompt
preprocessor
int values
5. * / % + -
dot (.)
break
polymorphism
Arithmetic Operators
6. This manipulator is used to establish a field width for the value immediately following it.
setw
t
srand
static_cast<char>(65)
7. The modulus operator (%) can be used only with __________.
selection
prompt
integer operands
static_cast<char>(65)
8. directive A statement that starts with a # is called a ____________.
Preprocessor
friend
ofstream
Unified Modeling Language(UML)
9. Returns the length of a string excluding the null terminator.
strlen()
return
special symbols
if
10. An expression that has operands with different data types
data type
type coercion
mixed expression
void
11. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
vectors
stack
getline
case sensitive
12. Grammar rules of the language; compiler will try to identify and locate syntax errors
inheritance
.cpp
syntax
NULL
13. This is used to mark the end of a complete C++ programming statement.
Semicolon
special symbols
void
break
14. 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
Counter-controlled or definite
Semicolon
?
base
15. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
globals
return
showpoint
16. The ________ of an identifier is the portion of the program in which the identifier can be used.
stack
#include <headerfilename>
cmath
scope
17. Nonexecutable statements that are included in a program to provide information about what the program does etc.
address
derived class
comments
attributes
18. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
n
address
Literals
19. To write data to a file you define an object of which one of the following
ofstream
::
subscript (or index)
template
20. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
const
<<
overloading
object-oriented analysis and design (OOAD)
21. A human readable file that contains C++ program
rand
Preprocessor
switch
source file
22. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
if...else
register
scope
public
23. 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
24. An expression in which all operands have the same data type - result will have the same data type as operands
classes
&
like-type expression
void
25. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
sorting
globals
whitespace
function prototype
26. Allows the programmer to store a value in a variable
virtual functions
break
allocating memory
assignment statement
27. A __________ data member represents class-wide information.
static
Semicolon
semicolon
*
28. 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.
//
cin >> variable
void
static
29. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
arithmetic expression
break
function overloading
30. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
#include directive
type casting (conversion)
constant variable
overloading
31. A function that calls itself
recursive function
Stack overflow
int values
local variable
32. The __________ operator reclaims memory previously allocated by new.
delete
cin >> variable
function call
before
33. Operator with only one operand
address
if
inline functions
unary operator
34. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
const
*
pointer
35. 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.
two-dimensional
operand value
void
scope
36. 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.
preprocessor
unary operator
dot (.)
address
37. A filestream variable that represents the default input source
return
overloading
cin
public
38. The ________ qualifier is used to declare read-only variables.
allocating memory
type coercion
const
preprocessor
39. __________ can be used to assign an object of a class to another object of the same class.
allocating memory
assignment
Default memberwise assignment
identifiers
40. A function that can be used to read character data including whitespace
operator
source file
constant variable
cin.get(ch)
41. Initializers __________ must be used to initialize constant members of a class.
member
overloading
pointer
operator overloading
42. Keyword public is a(n) _________
access specifier
type coercion
NULL
static
43. In inheritance the ____________ is the class the receives the inherited members.
register
semicolon
#include directive
derived class
44. Every C++ statement ends with a(n) _________.
assignment
semantics
local variable
semicolon
45. You can declare default values for a function in the ____________________.
function parameters
Stack overflow
sorting
const
46. The elements of an array are related by the fact that they have the same name and ___________.
Closing brace
attributes
preprocessor
type
47. Operator with two operands
.cpp
>>
binary operator
floating-point
48. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
assignment statement
heap
member
auto
49. int namespace include using return examples of ___________
information hiding
0
reserve words
#include <headerfilename>
50. The _________ begins the body of every function and the _________ ends the body of every function.
scope
{ }
#include
binary operator