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. 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.
globals
static
ofstream
?
2. data types that refer to numbers with decimals
main
floating-point
before
function overloading
3. Nonexecutable statements that are included in a program to provide information about what the program does etc.
comments
attributes
beginning
Semicolon
4. An operator that can only be used with int values. result will always be an int.
&
% modulus
semicolon
/n
5. To explicitly indicate that a value is to be converted to another type
friend
type casting (conversion)
named constant
cmath
6. A function is invoked with a ________.
token
static
identifiers
function call
7. An expression in which all operands have the same data type - result will have the same data type as operands
strcmp()
object file
like-type expression
int values
8. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
recursive
floating-point
private
object-oriented analysis and design (OOAD)
9. A memory location with a name and data type - its content may be changed during program execution
#include <headerfilename>
heap
variable
initialized
10. The __________ operator reclaims memory previously allocated by new.
void pointer
delete
semantics
source file
11. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
public
heap
object-oriented analysis and design (OOAD)
Unified Modeling Language(UML)
12. The three values that can be used to initialize a pointer are 0 - __________ and an address.
NULL
endl (same as 'n')
Default memberwise assignment
unary operator
13. The sign you use for pointers
scope
*
cin >> variable
associations
14. Program components in C++ are called functions and ________.
function call
register
virtual functions
classes
15. Names of things that are used in a program - can apply to variables & constants and functions
integer operands
::
static
identifiers
16. This manipulator causes the field to be left-justified with padding spaces printed to the right.
Counter-controlled or definite
left
scope resolution operator
char
17. Function ________ is used to set the random number seed to randomize a program.
srand
NULL
.cpp
case sensitive
18. Words that are used for special purposes in a program
showpoint
continue
{ }
reserved words
19. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
showpoint
semantics
integer operands
recursive function
20. Keyword public is a(n) _________
main
>>
subscript (or index)
access specifier
21. A type of pointer that can point at objects of any data type.
arithmetic expression
heap
mixed expression
void pointer
22. Executable version of program
::
linker
Sentinel
object file
23. In inheritance the ____________ is the class the receives the inherited members.
derived class
loader
variables
0
24. Symbol that denotes an action to be performed
function call
#include <headerfilename>
operator
address
25. 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.
sorting
void pointer
member
dot (.)
26. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
register
srand
auto
return
27. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
escape sequences
getline
virtual functions
type coercion
28. Sets floating-point values to a fixed decimal format
member
fixed
definition
floating-point
29. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
srand
reserve words
subscript (or index)
globals
30. Classes can have relationships with other classes. These relationships are called ________.
new line
associations
prompt
const
31. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
return
local variable
public
0
32. C++ programs are normally typed into a computer using a(n) ________ program.
type
{ }
editor
access specifier
33. A pointer is a variable that contains as its value the____________ of another variable.
Preprocessor
const
address
named constant
34. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
n
Literals
public
35. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
operator
Literals
getline
two-dimensional
36. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
public
break
preprocessor
case sensitive
37. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
scope
overloading
assignment
integer operands
38. The modulus operator (%) can be used only with __________.
semantics
case sensitive
semicolon
integer operands
39. The symbol for the binary scope resolution operator
case sensitive
::
Closing brace
default constructor
40. Forces the computer to display decimal point and trailing zeroes
floating-point
getline
showpoint
public
41. Every C++ statement ends with a(n) _________.
local variable
operator
source file
semicolon
42. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
unary operator
strcmp()
{ }
43. Member objects are constructed __________ their enclosing class object.
before
polymorphism
prompt
?
44. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
source file
classes
.cpp
inline functions
45. The ________ program transfers the executable image of a C++ program from disk to memory.
friend
beginning
loader
strcpy()
46. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
const datatype identifier = value
inline functions
inheritance
variable
47. = & | are examples of ____________.
a.out
special symbols
definition
inline functions
48. The storage-class specifiers are mutable - auto - ________ - extern and static.
Sentinel
template
register
Semicolon
49. A filestream variable that represents the default input source
function scope
cin
Counter-controlled or definite
srand
50. directive A statement that starts with a # is called a ____________.
subscript (or index)
function overloading
Preprocessor
endl (same as 'n')