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. A member function should be declared static if it does not access __________ class members.
{ }
inheritance
non-static
Closing brace
2. Used for function calls and local variables
derived class
access specifier
function scope
stack
3. int namespace include using return examples of ___________
reserve words
a.out
arithmetic expression
scope resolution operator
4. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
inline functions
classes
type casting (conversion)
operator overloading
5. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
switch
object file
.cpp
auto
6. When a value of one data type is implicitly (automatically) changed to another data type
char
const
assignment statement
type coercion
7. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
sorting
function parameters
if...else
cout
8. Most calculations are normally performed by ______ statements.
0
assignment
Closing brace
template
9. The sign you use for references
new line
0
return
&
10. Default name of executable file
a.out
Preprocessor
this
int values
11. The number used to refer to a particular element of an array is called its ________.
inheritance
Closing brace
subscript (or index)
&
12. Preprocessor directive syntax
classes
#include <headerfilename>
sorting
*
13. data types that refer to numbers with decimals
Closing brace
n
mixed expression
floating-point
14. Allows the programmer to store a value in a variable
searching
classes
strlen()
assignment statement
15. 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
beginning
break
delete
16. Associate an identifier with a memory location
#include <headerfilename>
allocating memory
public
arithmetic expression
17. A function ________ enables a single function to be defined to perform a task on many different data types.
dot (.)
template
named constant
?
18. The ________ program combines the output of the compiler with various library functions to produce an executable image.
return
object-oriented analysis and design (OOAD)
linker
function parameters
19. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
#include directive
source file
setw
20. You must have a ___________ for every variable you intend to use in a program
function call
Literals
definition
>>
21. 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.
?
#include
pointer
overloading
22. Executable version of program
object file
address
pointer
assignment
23. To allow file access in a program you must #include this header file.
address
fstream
recursive
assignment
24. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
information hiding
base class
variable
named constant
25. An array that uses two subscripts is referred to as a(n) _________ array.
Arithmetic Operators
two-dimensional
strcmp()
vectors
26. 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.
Counter-controlled or definite
heap
static
Arithmetic Operators
27. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
virtual functions
whitespace
<<
28. Creates a copy of a string.
rand
unary scope resolution operator (::)
pointer
strcpy()
29. tab
preprocessor
cin.get(ch)
t
type coercion
30. The ________ of an identifier is the portion of the program in which the identifier can be used.
void
scope
classes
virtual functions
31. Header file that contains commonly performed mathematical functions
global
object-oriented analysis and design (OOAD)
cmath
preprocessor
32. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
allocating memory
new line
?
escape sequences
33. Function ________ is used to produce random numbers.
rand
/n
operator overloading
recursive function
34. For every opening brace in a C++ program there must be a ______________.
Closing brace
arithmetic expression
whitespace
stack
35. A variable declared outside any block or function is a ________ variable.
global
reserve words
void
static
36. In inheritance the ____________ is the class the receives the inherited members.
function scope
t
derived class
floating-point
37. The modulus operator (%) can be used only with __________.
static
integer operands
getline
global
38. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
showpoint
switch
static
cout
39. Characters used to separate symbols or reserved words or identifiers and statements
a.out
function parameters
whitespace
syntax
40. = & | are examples of ____________.
loader
special symbols
if...else
virtual functions
41. An operator that can only be used with int values. result will always be an int.
% modulus
Semicolon
srand
dot (.)
42. 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.
return
inheritance
virtual functions
stack
43. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
static
{ }
void
function prototype
44. A file must be ________ before data can be written to or read from it.
token
opened
operator
floating-point
45. Keyword public is a(n) _________
access specifier
delete
strlen()
const datatype identifier = value
46. A variable that is known only within the function in which it is defined is called a ________.
local variable
if
% modulus
NULL
47. A sequence of operands and operators that describe a calculation to be performed
arithmetic expression
showpoint
Sentinel
a.out
48. 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.
Default memberwise assignment
dot (.)
continue
function overloading
49. The ________ qualifier is used to declare read-only variables.
const
default constructor
before
cin >> variable
50. Compares two strings and returns 0 if they are equal.
char
showpoint
subscript (or index)
strcmp()