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. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
main
vectors
int values
2. A member function should be declared static if it does not access __________ class members.
template
Counter-controlled or definite
cout
non-static
3. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
0
function scope
void pointer
void
4. The ________ qualifier is used to declare read-only variables.
const
source file
allocating memory
two-dimensional
5. tab
*
t
register
% modulus
6. Every C++ statement ends with a(n) _________.
comments
stack
semicolon
void
7. The three values that can be used to initialize a pointer are 0 - __________ and an address.
member
heap
NULL
ofstream
8. Associate an identifier with a memory location
static_cast<char>(65)
allocating memory
virtual functions
/n
9. A variable that is known only within the function in which it is defined is called a ________.
heap
fstream
.cpp
local variable
10. Header file that contains commonly performed mathematical functions
srand
function parameters
cmath
Preprocessor
11. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
variables
#include <headerfilename>
member
auto
12. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
#include directive
getline
two-dimensional
const
13. Whole numbers - no decimals and no commas included
<<
overloading
polymorphism
int values
14. The process of analyzing and designing a system from an object-oriented point of view is called ________.
semantics
object-oriented analysis and design (OOAD)
Closing brace
data type
15. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
object file
before
recursive
function overloading
16. A __________ should be used to declare the size of an array because it makes the program more scalable.
comments
void pointer
scope
constant variable
17. Function ________ is used to set the random number seed to randomize a program.
srand
Closing brace
operator
showpoint
18. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
scope
auto
#include directive
19. An expression in which all operands have the same data type - result will have the same data type as operands
before
like-type expression
heap
continue
20. A filestream variable that represents the default input source
auto
cin
a.out
continue
21. The idea that you can call the same function and the output will depend on the type of object you're using.
main
polymorphism
cin.get(ch)
pointer
22. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
>>
function call
const
template
23. * / % + -
dot (.)
Arithmetic Operators
information hiding
>>
24. The elements of an array are related by the fact that they have the same name and ___________.
type
data type
0
void
25. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
type casting (conversion)
?
break
polymorphism
26. An operator that can only be used with int values. result will always be an int.
% modulus
cin
endl (same as 'n')
selection
27. A memory location with a name and data type - its content may be changed during program execution
default constructor
data type
variable
break
28. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
return
recursive
register
29. Syntax for named constant declaration
cmath
const datatype identifier = value
binary operator
heap
30. Keyword public is a(n) _________
Stack overflow
address
access specifier
source file
31. 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 (.)
type
information hiding
static
32. A function ________ enables a single function to be defined to perform a task on many different data types.
overloading
template
pointer
initialized
33. A variable that holds the address of another variable.
floating-point
pointer
>>
reserved words
34. C++ programs are normally typed into a computer using a(n) ________ program.
function scope
semantics
editor
Preprocessor
35. Names of things that are used in a program - can apply to variables & constants and functions
pointer
semantics
inheritance
identifiers
36. Words that are used for special purposes in a program
#include
before
reserved words
static
37. 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.
ofstream
like-type expression
continue
virtual functions
38. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
type coercion
pointer
//
dot (.)
39. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
access specifier
globals
beginning
40. A variable declared outside any block or function is a ________ variable.
int values
function prototype
const datatype identifier = value
global
41. A set of values together with a set of operations
left
constant variable
function call
data type
42. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
variables
private
floating-point
dot (.)
43. Classes can have relationships with other classes. These relationships are called ________.
srand
derived class
recursive
associations
44. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.
opened
Sentinel
const
reserved words
45. 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.
semicolon
/n
assignment statement
{ }
46. A function that calls itself
recursive function
subscript (or index)
setw
template
47. The only integer that can be assigned directly to a pointer is_____________.
local variable
Sentinel
token
0
48. A constant object must be __________; it cannot be modified after it is created.
operand value
const
heap
initialized
49. Operator with two operands
semantics
binary operator
associations
&
50. Function ________ is used to produce random numbers.
cmath
pointer
rand
private