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. In inheritance the ____________ is the class the receives the inherited members.
two-dimensional
derived class
named constant
object-oriented analysis and design (OOAD)
2. Repeating a set of instructions a specific number of times is called_________repetition.
Default memberwise assignment
Counter-controlled or definite
operand value
type casting (conversion)
3. directive A statement that starts with a # is called a ____________.
Preprocessor
Default memberwise assignment
whitespace
derived class
4. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
{ }
% modulus
new line
variable
5. 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.
<<
fixed
Closing brace
/n
6. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
template
if
subscript (or index)
7. 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.
token
setw
left
inheritance
8. An operator that can only be used with int values. result will always be an int.
//
const
return
% modulus
9. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
return
friend
Stack overflow
char
10. A human readable file that contains C++ program
Arithmetic Operators
access specifier
inline functions
source file
11. A __________ should be used to declare the size of an array because it makes the program more scalable.
/n
constant variable
&
strcmp()
12. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
source file
global
heap
13. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
endl (same as 'n')
initialized
if...else
pointer
14. A function ________ enables a single function to be defined to perform a task on many different data types.
.cpp
arithmetic expression
subscript (or index)
template
15. The address-of operator. it is used to assign pointers and to print the address of variables.
globals
&
local variable
named constant
16. The process of placing the elements of an array in order is called ________ the array.
::
sorting
comments
recursive function
17. Syntax for named constant declaration
default constructor
variable
const datatype identifier = value
sorting
18. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
prompt
pointer
preprocessor
19. int namespace include using return examples of ___________
fstream
escape sequences
::
reserve words
20. Message displayed to the screen asking user for input; generated with an output statement
function prototype
prompt
private
vectors
21. Associate an identifier with a memory location
#include directive
allocating memory
return
heap
22. A function is invoked with a ________.
associations
linker
function call
binary operator
23. tab
virtual functions
recursive function
t
Counter-controlled or definite
24. * / % + -
fixed
scope resolution operator
NULL
Arithmetic Operators
25. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
allocating memory
source file
const datatype identifier = value
26. Returns the length of a string excluding the null terminator.
void
strlen()
virtual functions
delete
27. A member function should be declared static if it does not access __________ class members.
Literals
non-static
inline functions
Closing brace
28. A memory location with a name and data type - its content may be changed during program execution
return
variable
two-dimensional
base
29. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
pointer
fixed
#include
30. Header file that contains commonly performed mathematical functions
cmath
object file
if...else
pointer
31. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
data type
classes
{ }
Sentinel
32. For every opening brace in a C++ program there must be a ______________.
syntax
Closing brace
const datatype identifier = value
linker
33. Names of things that are used in a program - can apply to variables & constants and functions
like-type expression
identifiers
unary scope resolution operator (::)
operator
34. Lists and tables of values can be stored in arrays or __________.
Literals
subscript (or index)
% modulus
vectors
35. The process of determining if an array contains a particular key value is called _________ the array.
selection
preprocessor
searching
heap
36. The three values that can be used to initialize a pointer are 0 - __________ and an address.
semicolon
&
escape sequences
NULL
37. A type of pointer that can point at objects of any data type.
non-static
void pointer
function overloading
NULL
38. A C++ statement that makes a decision is ______.
attributes
recursive
if
function scope
39. 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.
virtual functions
#include directive
function prototype
global
40. A set of values together with a set of operations
switch
arithmetic expression
data type
special symbols
41. 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.
recursive
definition
static
strcpy()
42. A __________ data member represents class-wide information.
a.out
*
Counter-controlled or definite
static
43. Used to qualify hidden names so that they can be used.
binary operator
assignment
scope resolution operator
const
44. A filestream variable that represents the default input source
cin
register
prompt
classes
45. All C++ Variables are_________.
case sensitive
type
const datatype identifier = value
cmath
46. Two slash marks ( // ) indicate __________ of a comment
const
object file
beginning
constant variable
47. Type casting syntax
cout
cmath
static_cast<char>(65)
operator
48. Grammar rules of the language; compiler will try to identify and locate syntax errors
special symbols
overloading
Semicolon
syntax
49. A variable declared outside any block or function is a ________ variable.
reserved words
token
preprocessor
global
50. Forces the computer to display decimal point and trailing zeroes
subscript (or index)
strcpy()
private
showpoint