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 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
Default memberwise assignment
endl (same as 'n')
base
strcpy()
2. 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.
static
before
information hiding
syntax
3. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
heap
classes
function scope
semicolon
4. Every C++ statement ends with a(n) _________.
Sentinel
semicolon
global
pointer
5. Compares two strings and returns 0 if they are equal.
unary scope resolution operator (::)
return
associations
strcmp()
6. A function that calls itself
recursive function
fixed
template
semantics
7. Classes can have relationships with other classes. These relationships are called ________.
associations
register
cmath
void pointer
8. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
scope
return
.cpp
friend
9. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
Unified Modeling Language(UML)
source file
global
binary operator
10. Identifier or expression that is part of the calculation to be performed
operand value
&
delete
rand
11. Preprocessor directive syntax
Literals
heap
strcmp()
#include <headerfilename>
12. The only integer that can be assigned directly to a pointer is_____________.
loader
Closing brace
0
a.out
13. A memory location with a name and data type - its content may be changed during program execution
char
variable
editor
::
14. Used for dynamically allocated variables
cin
new line
heap
Unified Modeling Language(UML)
15. Whole numbers - no decimals and no commas included
unary scope resolution operator (::)
type coercion
return
int values
16. * / % + -
Closing brace
Arithmetic Operators
unary operator
Sentinel
17. For every opening brace in a C++ program there must be a ______________.
Closing brace
type casting (conversion)
arithmetic expression
operator overloading
18. The __________ operator reclaims memory previously allocated by new.
Counter-controlled or definite
non-static
delete
syntax
19. __________ can be used to assign an object of a class to another object of the same class.
NULL
strlen()
register
Default memberwise assignment
20. The three values that can be used to initialize a pointer are 0 - __________ and an address.
Preprocessor
NULL
allocating memory
constant variable
21. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
case sensitive
reserve words
before
register
22. The number used to refer to a particular element of an array is called its ________.
Literals
{ }
subscript (or index)
static_cast<char>(65)
23. A member function should be declared static if it does not access __________ class members.
non-static
special symbols
#include
getline
24. Executable version of program
#include directive
continue
object file
escape sequences
25. To explicitly indicate that a value is to be converted to another type
strlen()
reserve words
type casting (conversion)
int values
26. A function that can be used to read character data including whitespace
fixed
const
cin.get(ch)
access specifier
27. This is used to mark the end of a complete C++ programming statement.
Semicolon
Closing brace
Literals
information hiding
28. A program that finds and attaches to your program the indicated libraries for compilation
#include
classes
NULL
preprocessor
29. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
>>
arithmetic expression
semantics
pointer
30. = & | are examples of ____________.
special symbols
&
/n
recursive
31. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
derived class
non-static
unary operator
const
32. A pointer is a variable that contains as its value the____________ of another variable.
void
const
address
if
33. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
constant variable
#include directive
this
classes
34. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
continue
setw
switch
prompt
35. The stream extraction operator
static_cast<char>(65)
>>
preprocessor
strcmp()
36. directive A statement that starts with a # is called a ____________.
fstream
operator
function parameters
Preprocessor
37. A function is invoked with a ________.
function call
Closing brace
type casting (conversion)
semicolon
38. Message displayed to the screen asking user for input; generated with an output statement
variables
source file
.cpp
prompt
39. The process of placing the elements of an array in order is called ________ the array.
sorting
recursive
function overloading
pointer
40. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
//
attributes
*
main
41. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
cmath
fixed
#include directive
function prototype
42. 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.
?
named constant
base
delete
43. The address-of operator. it is used to assign pointers and to print the address of variables.
subscript (or index)
function overloading
unary operator
&
44. Forces the computer to display decimal point and trailing zeroes
showpoint
::
allocating memory
assignment statement
45. Class members specified as _________ are accessible anywhere an object of the class is in scope.
<<
public
*
semantics
46. 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.
/n
preprocessor
&
*
47. The ________ program transfers the executable image of a C++ program from disk to memory.
Default memberwise assignment
*
loader
endl (same as 'n')
48. An array that uses two subscripts is referred to as a(n) _________ array.
main
virtual functions
fstream
two-dimensional
49. Returns the length of a string excluding the null terminator.
strlen()
endl (same as 'n')
searching
::
50. int namespace include using return examples of ___________
editor
register
reserve words
getline