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. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
reserved words
fstream
Preprocessor
overloading
2. Forces the computer to display decimal point and trailing zeroes
escape sequences
showpoint
cin.get(ch)
cmath
3. Most calculations are normally performed by ______ statements.
reserved words
like-type expression
default constructor
assignment
4. The process of placing the elements of an array in order is called ________ the array.
allocating memory
initialized
sorting
//
5. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
recursive
associations
cmath
unary operator
6. The _____ causes the contents of another file to be inserted into a program.
cin.get(ch)
?
delete
#include directive
7. A file must be ________ before data can be written to or read from it.
Stack overflow
subscript (or index)
main
opened
8. A memory location with a name and data type - its content may be changed during program execution
variable
new line
static
Preprocessor
9. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
virtual functions
escape sequences
static
semantics
10. For every opening brace in a C++ program there must be a ______________.
scope resolution operator
searching
operand value
Closing brace
11. 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.
continue
base
polymorphism
function parameters
12. Preprocessor directive syntax
#include <headerfilename>
/n
if
definition
13. int namespace include using return examples of ___________
reserve words
classes
const datatype identifier = value
unary scope resolution operator (::)
14. Class members specified as _________ are accessible anywhere an object of the class is in scope.
reserve words
#include <headerfilename>
public
floating-point
15. Creates a copy of a string.
auto
strcpy()
operator overloading
inline functions
16. When a value of one data type is implicitly (automatically) changed to another data type
syntax
function parameters
type coercion
Arithmetic Operators
17. The modulus operator (%) can be used only with __________.
integer operands
arithmetic expression
break
opened
18. A function that calls itself
loader
recursive function
Preprocessor
private
19. Function ________ is used to set the random number seed to randomize a program.
srand
initialized
continue
like-type expression
20. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
const
if
?
21. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
n
information hiding
before
22. The _________ begins the body of every function and the _________ ends the body of every function.
constant variable
strlen()
binary operator
{ }
23. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
0
private
::
named constant
24. The stream insertion operator
token
variable
<<
ofstream
25. The __________ operator reclaims memory previously allocated by new.
data type
delete
inline functions
preprocessor
26. 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.
special symbols
?
default constructor
identifiers
27. Every C++ program begins execution at the function _________.
main
Literals
register
prompt
28. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
fstream
overloading
register
function prototype
29. Type casting syntax
non-static
virtual functions
function overloading
static_cast<char>(65)
30. Naming convention for C++ programs
switch
arithmetic expression
.cpp
like-type expression
31. To explicitly indicate that a value is to be converted to another type
scope
type casting (conversion)
prompt
setw
32. The ________ statement in a called function passes the value of an expression back to the calling function.
0
base
return
#include <headerfilename>
33. Compares two strings and returns 0 if they are equal.
preprocessor
strcmp()
n
assignment statement
34. The sign you use for references
global
&
member
variables
35. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
default constructor
scope resolution operator
object file
36. A function ________ enables a single function to be defined to perform a task on many different data types.
template
cin
pointer
register
37. 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
operator overloading
linker
base
% modulus
38. Lists and tables of values can be stored in arrays or __________.
vectors
?
type casting (conversion)
register
39. Used for dynamically allocated variables
friend
preprocessor
heap
fstream
40. 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 (.)
Default memberwise assignment
loader
Sentinel
41. 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.
variable
?
/n
beginning
42. A type of pointer that can point at objects of any data type.
void pointer
reserved words
private
t
43. A __________ should be used to declare the size of an array because it makes the program more scalable.
strcpy()
ofstream
definition
constant variable
44. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
default constructor
subscript (or index)
selection
ofstream
45. In inheritance the ____________ is the class that supplies the inherited members.
associations
searching
base class
function overloading
46. The ________ program transfers the executable image of a C++ program from disk to memory.
linker
loader
Literals
scope resolution operator
47. Every C++ statement ends with a(n) _________.
endl (same as 'n')
semicolon
pointer
subscript (or index)
48. This manipulator causes the field to be left-justified with padding spaces printed to the right.
base
left
if
named constant
49. Allows the programmer to store a value in a variable
function parameters
void pointer
allocating memory
assignment statement
50. Classes can have relationships with other classes. These relationships are called ________.
associations
cout
inheritance
&