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. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
endl (same as 'n')
strlen()
n
2. The sign you use for pointers
*
cin.get(ch)
object-oriented analysis and design (OOAD)
function prototype
3. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
Counter-controlled or definite
pointer
token
4. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
heap
constant variable
information hiding
5. The __________ operator reclaims memory previously allocated by new.
void pointer
information hiding
*
delete
6. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
sorting
classes
named constant
whitespace
7. Two slash marks ( // ) indicate __________ of a comment
member
function call
preprocessor
beginning
8. Sets floating-point values to a fixed decimal format
derived class
prompt
fixed
pointer
9. Used for dynamically allocated variables
heap
variable
object file
&
10. A function that can be used to read character data including whitespace
cin
heap
cin.get(ch)
return
11. Keyword public is a(n) _________
stack
Unified Modeling Language(UML)
access specifier
.cpp
12. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
classes
void
ofstream
base class
13. Used for function calls and local variables
return
linker
stack
function prototype
14. Function ________ is used to set the random number seed to randomize a program.
cout
t
srand
int values
15. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
//
data type
variable
16. The size & shape & color and weight of an object are considered
attributes
escape sequences
cout
definition
17. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
cout
information hiding
//
selection
18. C++ programs are normally typed into a computer using a(n) ________ program.
data type
stack
editor
function prototype
19. The stream insertion operator
comments
auto
<<
*
20. Grammar rules of the language; compiler will try to identify and locate syntax errors
static_cast<char>(65)
/n
strlen()
syntax
21. The ________ enables access to a global variable with the same name as a variable in the current scope.
showpoint
data type
attributes
unary scope resolution operator (::)
22. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
>>
cin >> variable
initialized
escape sequences
23. 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.
cmath
inheritance
constant variable
associations
24. A file must be ________ before data can be written to or read from it.
opened
//
strcmp()
const datatype identifier = value
25. Header file that contains commonly performed mathematical functions
cmath
private
global
left
26. The elements of an array are related by the fact that they have the same name and ___________.
type
&
non-static
register
27. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
n
definition
overloading
const
28. All ______ must be declared before they are used.
variables
Default memberwise assignment
scope
before
29. 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.
fstream
escape sequences
delete
Sentinel
30. The ________ qualifier is used to declare read-only variables.
data type
% modulus
break
const
31. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
*
const
searching
object file
32. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
cmath
#include
member
heap
33. newline
base
before
if
n
34. When a value of one data type is implicitly (automatically) changed to another data type
showpoint
const datatype identifier = value
type coercion
token
35. You can declare default values for a function in the ____________________.
>>
floating-point
template
function parameters
36. The stream extraction operator
>>
prompt
rand
identifiers
37. The only integer that can be assigned directly to a pointer is_____________.
const
address
0
% modulus
38. The _____ causes the contents of another file to be inserted into a program.
Literals
left
#include directive
editor
39. A memory location with a name and data type - its content may be changed during program execution
definition
variable
operator
scope resolution operator
40. The symbol for the binary scope resolution operator
/n
::
switch
reserve words
41. A member function should be declared static if it does not access __________ class members.
new line
data type
non-static
private
42. Executable version of program
t
cin
object file
static
43. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
two-dimensional
return
strlen()
inline functions
44. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
cmath
template
function prototype
arithmetic expression
45. A constant object must be __________; it cannot be modified after it is created.
strcpy()
function parameters
initialized
cin
46. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
int values
globals
assignment statement
47. A sequence of operands and operators that describe a calculation to be performed
template
Sentinel
globals
arithmetic expression
48. = & | are examples of ____________.
editor
special symbols
reserved words
scope resolution operator
49. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
named constant
//
Stack overflow
source file
50. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
auto
break
srand
>>