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 function that calls itself either directly or indirectly - through another function) - is a ________ function.
#include
recursive
Arithmetic Operators
const datatype identifier = value
2. When a value of one data type is implicitly (automatically) changed to another data type
setw
type coercion
private
return
3. * / % + -
escape sequences
recursive function
Arithmetic Operators
operator overloading
4. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
cin >> variable
endl (same as 'n')
global
operator overloading
5. __________ can be used to assign an object of a class to another object of the same class.
getline
default constructor
Default memberwise assignment
function call
6. Compares two strings and returns 0 if they are equal.
strcmp()
char
main
Unified Modeling Language(UML)
7. This manipulator causes the field to be left-justified with padding spaces printed to the right.
const datatype identifier = value
left
new line
classes
8. An expression in which all operands have the same data type - result will have the same data type as operands
left
like-type expression
char
Closing brace
9. The __________ operator reclaims memory previously allocated by new.
function parameters
strcmp()
getline
delete
10. A human readable file that contains C++ program
if
source file
searching
cmath
11. These are data items whose values do not change while the program is running
*
//
Literals
static
12. Member objects are constructed __________ their enclosing class object.
before
&
like-type expression
derived class
13. A type of pointer that can point at objects of any data type.
void pointer
strcpy()
rand
public
14. Classes can have relationships with other classes. These relationships are called ________.
ofstream
inline functions
opened
associations
15. = & | are examples of ____________.
cin
Preprocessor
whitespace
special symbols
16. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
mixed expression
*
inline functions
constant variable
17. 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.
static
pointer
break
derived class
18. A function is invoked with a ________.
function call
&
special symbols
const
19. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
/n
const datatype identifier = value
Closing brace
cin >> variable
20. Two slash marks ( // ) indicate __________ of a comment
beginning
cin.get(ch)
data type
function call
21. The ________ qualifier is used to declare read-only variables.
const
sorting
Closing brace
prompt
22. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
Arithmetic Operators
&
this
member
23. A variable that holds the address of another variable.
type coercion
pointer
variables
left
24. For every opening brace in a C++ program there must be a ______________.
auto
Closing brace
type
left
25. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
>>
const
this
definition
26. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
Sentinel
case sensitive
public
Unified Modeling Language(UML)
27. Creates a copy of a string.
access specifier
strcpy()
member
Literals
28. Words that are used for special purposes in a program
source file
reserved words
comments
polymorphism
29. Naming convention for C++ programs
pointer
cout
public
.cpp
30. An operator that can only be used with int values. result will always be an int.
showpoint
% modulus
cin >> variable
register
31. You must have a ___________ for every variable you intend to use in a program
definition
access specifier
static_cast<char>(65)
arithmetic expression
32. Whole numbers - no decimals and no commas included
>>
main
srand
int values
33. This is used to mark the end of a complete C++ programming statement.
variable
fstream
Semicolon
.cpp
34. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
public
void pointer
register
attributes
35. Default name of executable file
<<
stack
type casting (conversion)
a.out
36. Use 2 characters to represent one
template
Closing brace
escape sequences
assignment
37. A memory location with a name and data type - its content may be changed during program execution
unary operator
auto
variable
cin.get(ch)
38. If a member initializer is not provided for a member object of a class the object's __________ is called.
recursive
static_cast<char>(65)
default constructor
sorting
39. Repeating a set of instructions a specific number of times is called_________repetition.
Counter-controlled or definite
constant variable
::
if...else
40. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
this
type
stack
41. A __________ should be used to declare the size of an array because it makes the program more scalable.
a.out
prompt
linker
constant variable
42. The size & shape & color and weight of an object are considered
ofstream
% modulus
attributes
&
43. Lists and tables of values can be stored in arrays or __________.
variable
Sentinel
% modulus
vectors
44. Function ________ is used to set the random number seed to randomize a program.
editor
return
srand
subscript (or index)
45. Function ________ is used to produce random numbers.
virtual functions
reserved words
constant variable
rand
46. A program that finds and attaches to your program the indicated libraries for compilation
Sentinel
preprocessor
classes
before
47. The address-of operator. it is used to assign pointers and to print the address of variables.
strlen()
&
derived class
left
48. The idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
function overloading
attributes
address
49. Type casting syntax
template
static_cast<char>(65)
if
Unified Modeling Language(UML)
50. The process of determining if an array contains a particular key value is called _________ the array.
searching
scope resolution operator
pointer
Counter-controlled or definite