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 keyword __________ specifies that an object or variable is not modifiable after it is initialized.
identifiers
setw
editor
const
2. An operator that can only be used with int values. result will always be an int.
constant variable
% modulus
reserve words
escape sequences
3. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
strcmp()
t
dot (.)
4. 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.
#include directive
if...else
/n
inheritance
5. Default name of executable file
variable
a.out
main
subscript (or index)
6. A memory location with a name and data type - its content may be changed during program execution
type coercion
reserved words
assignment
variable
7. The __________ operator reclaims memory previously allocated by new.
inheritance
% modulus
delete
cout
8. The elements of an array are related by the fact that they have the same name and ___________.
type
recursive
char
void
9. A variable declared outside any block or function is a ________ variable.
const datatype identifier = value
semantics
global
a.out
10. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
new line
const
selection
#include
11. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
variable
recursive
function parameters
pointer
12. Program components in C++ are called functions and ________.
global
object-oriented analysis and design (OOAD)
overloading
classes
13. The stream extraction operator
delete
whitespace
?
>>
14. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
setw
named constant
pointer
char
15. A type of pointer that can point at objects of any data type.
base class
reserve words
void pointer
Closing brace
16. 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.
switch
{ }
token
?
17. Function ________ is used to set the random number seed to randomize a program.
function call
left
srand
fstream
18. If a member initializer is not provided for a member object of a class the object's __________ is called.
editor
opened
getline
default constructor
19. The sign you use for references
fixed
endl (same as 'n')
&
operand value
20. A function that can be used to read character data including whitespace
token
const datatype identifier = value
cin.get(ch)
searching
21. directive A statement that starts with a # is called a ____________.
Preprocessor
fstream
access specifier
binary operator
22. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
auto
getline
endl (same as 'n')
Semicolon
23. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
preprocessor
beginning
friend
void
24. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
associations
globals
left
25. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
static
private
associations
int values
26. Operator with two operands
special symbols
globals
binary operator
arithmetic expression
27. A filestream variable that represents the default input source
void
definition
cin
polymorphism
28. 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.
beginning
t
inline functions
virtual functions
29. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
pointer
Unified Modeling Language(UML)
non-static
opened
30. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
floating-point
syntax
new line
continue
31. The process of placing the elements of an array in order is called ________ the array.
sorting
data type
cin >> variable
Sentinel
32. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
Counter-controlled or definite
variable
break
function scope
33. An expression in which all operands have the same data type - result will have the same data type as operands
pointer
non-static
delete
like-type expression
34. To write data to a file you define an object of which one of the following
ofstream
void
special symbols
global
35. Type casting syntax
data type
preprocessor
continue
static_cast<char>(65)
36. A variable that is known only within the function in which it is defined is called a ________.
heap
const datatype identifier = value
local variable
comments
37. Syntax for named constant declaration
const datatype identifier = value
token
operand value
/n
38. Classes can have relationships with other classes. These relationships are called ________.
variables
floating-point
break
associations
39. Member objects are constructed __________ their enclosing class object.
const datatype identifier = value
before
function call
Closing brace
40. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
Literals
allocating memory
classes
token
41. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
private
classes
void
pointer
42. Preprocessor directive syntax
dot (.)
fixed
#include <headerfilename>
function call
43. A ________ program executes before the compiler's translation phase begins.
preprocessor
Unified Modeling Language(UML)
reserve words
n
44. Whole numbers - no decimals and no commas included
&
non-static
int values
{ }
45. 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
a.out
#include <headerfilename>
const datatype identifier = value
46. The symbol for the binary scope resolution operator
source file
?
subscript (or index)
::
47. Lists and tables of values can be stored in arrays or __________.
object-oriented analysis and design (OOAD)
fstream
vectors
recursive
48. = & | are examples of ____________.
definition
special symbols
base class
type coercion
49. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
pointer
cin >> variable
t
50. The ________ of an identifier is the portion of the program in which the identifier can be used.
cin
scope
auto
rand