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 __________ data member represents class-wide information.
selection
overloading
Stack overflow
static
2. An array that uses two subscripts is referred to as a(n) _________ array.
type coercion
strcpy()
two-dimensional
public
3. 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
srand
break
Arithmetic Operators
4. Repeating a set of instructions a specific number of times is called_________repetition.
Counter-controlled or definite
char
Preprocessor
loader
5. This manipulator is used to establish a field width for the value immediately following it.
mixed expression
setw
recursive
object-oriented analysis and design (OOAD)
6. The ________ qualifier is used to declare read-only variables.
Default memberwise assignment
Counter-controlled or definite
const
special symbols
7. Operator with two operands
cin
variable
beginning
binary operator
8. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
mixed expression
allocating memory
scope
9. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
floating-point
Counter-controlled or definite
>>
pointer
10. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
semantics
private
int values
globals
11. Keyword public is a(n) _________
strcpy()
escape sequences
return
access specifier
12. In inheritance the ____________ is the class the receives the inherited members.
derived class
local variable
dot (.)
definition
13. A member function should be declared static if it does not access __________ class members.
reserved words
non-static
data type
dot (.)
14. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
static_cast<char>(65)
this
access specifier
register
15. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
cin.get(ch)
Stack overflow
function call
new line
16. If a member initializer is not provided for a member object of a class the object's __________ is called.
selection
default constructor
data type
Unified Modeling Language(UML)
17. Message displayed to the screen asking user for input; generated with an output statement
showpoint
endl (same as 'n')
stack
prompt
18. Member objects are constructed __________ their enclosing class object.
operator overloading
register
heap
before
19. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
inheritance
selection
before
if...else
20. The ________ program combines the output of the compiler with various library functions to produce an executable image.
0
function prototype
a.out
linker
21. Class members specified as _________ are accessible anywhere an object of the class is in scope.
information hiding
inheritance
a.out
public
22. Syntax for named constant declaration
t
special symbols
const datatype identifier = value
Preprocessor
23. The number used to refer to a particular element of an array is called its ________.
function call
if...else
subscript (or index)
Closing brace
24. A function ________ enables a single function to be defined to perform a task on many different data types.
prompt
template
cin >> variable
//
25. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
auto
void
overloading
left
26. Used for function calls and local variables
global
stack
subscript (or index)
classes
27. Forces the computer to display decimal point and trailing zeroes
continue
type casting (conversion)
showpoint
selection
28. These are data items whose values do not change while the program is running
integer operands
Stack overflow
token
Literals
29. A filestream variable that represents the default input source
cin
switch
base
integer operands
30. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
static
whitespace
token
const datatype identifier = value
31. Most calculations are normally performed by ______ statements.
break
derived class
assignment
object file
32. Allows the programmer to store a value in a variable
assignment statement
>>
scope
like-type expression
33. You can declare default values for a function in the ____________________.
escape sequences
function parameters
0
delete
34. The _____ causes the contents of another file to be inserted into a program.
whitespace
information hiding
NULL
#include directive
35. Returns the length of a string excluding the null terminator.
new line
strlen()
pointer
virtual functions
36. The size & shape & color and weight of an object are considered
register
two-dimensional
attributes
heap
37. = & | are examples of ____________.
strcmp()
static
semicolon
special symbols
38. Type casting syntax
reserve words
static
Default memberwise assignment
static_cast<char>(65)
39. 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.
t
public
strlen()
?
40. A ________ program executes before the compiler's translation phase begins.
operand value
private
attributes
preprocessor
41. A type of pointer that can point at objects of any data type.
associations
Semicolon
void pointer
a.out
42. Compares two strings and returns 0 if they are equal.
beginning
new line
private
strcmp()
43. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
const
classes
source file
?
44. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
t
polymorphism
arithmetic expression
register
45. Naming convention for C++ programs
new line
.cpp
constant variable
/n
46. A program that finds and attaches to your program the indicated libraries for compilation
if...else
% modulus
preprocessor
Literals
47. 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.
case sensitive
type casting (conversion)
static
preprocessor
48. Every C++ program begins execution at the function _________.
two-dimensional
main
cin
type
49. A function that calls itself
recursive function
main
static
member
50. The __________ operator reclaims memory previously allocated by new.
delete
register
char
integer operands