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. directive A statement that starts with a # is called a ____________.
0
Preprocessor
globals
classes
2. 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.
operator overloading
continue
scope resolution operator
template
3. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
&
stack
pointer
searching
4. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
static
continue
non-static
5. In inheritance the ____________ is the class that supplies the inherited members.
semantics
named constant
base class
const
6. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
searching
friend
if...else
7. To write data to a file you define an object of which one of the following
ofstream
type casting (conversion)
Default memberwise assignment
cin >> variable
8. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
//
public
template
9. A filestream variable that represents the default input source
const
variable
% modulus
cin
10. 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.
n
::
access specifier
Sentinel
11. The _____ causes the contents of another file to be inserted into a program.
#include directive
token
member
stack
12. All C++ Variables are_________.
case sensitive
beginning
int values
function prototype
13. The elements of an array are related by the fact that they have the same name and ___________.
type
int values
pointer
&
14. Lists and tables of values can be stored in arrays or __________.
comments
getline
vectors
cin
15. Names of things that are used in a program - can apply to variables & constants and functions
arithmetic expression
preprocessor
special symbols
identifiers
16. The three values that can be used to initialize a pointer are 0 - __________ and an address.
vectors
prompt
dot (.)
NULL
17. A type of pointer that can point at objects of any data type.
strcmp()
const datatype identifier = value
void pointer
auto
18. * / % + -
return
Arithmetic Operators
cin.get(ch)
main
19. Most calculations are normally performed by ______ statements.
delete
heap
<<
assignment
20. Two slash marks ( // ) indicate __________ of a comment
integer operands
switch
beginning
opened
21. The __________ operator reclaims memory previously allocated by new.
auto
char
delete
this
22. Every C++ statement ends with a(n) _________.
semicolon
auto
const
member
23. 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
{ }
return
setw
24. 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.
Stack overflow
recursive
rand
?
25. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
syntax
Preprocessor
private
Arithmetic Operators
26. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
integer operands
srand
derived class
27. Returns the length of a string excluding the null terminator.
assignment
strlen()
getline
identifiers
28. The number used to refer to a particular element of an array is called its ________.
::
integer operands
subscript (or index)
scope resolution operator
29. The sign you use for pointers
Literals
*
editor
register
30. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
continue
Stack overflow
strcmp()
cin >> variable
31. The address-of operator. it is used to assign pointers and to print the address of variables.
unary scope resolution operator (::)
Unified Modeling Language(UML)
public
&
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.
function parameters
.cpp
break
opened
33. Use 2 characters to represent one
const datatype identifier = value
escape sequences
.cpp
syntax
34. The stream insertion operator
>>
binary operator
semantics
<<
35. The ________ program combines the output of the compiler with various library functions to produce an executable image.
constant variable
int values
linker
function parameters
36. An array that uses two subscripts is referred to as a(n) _________ array.
linker
two-dimensional
arithmetic expression
dot (.)
37. A memory location with a name and data type - its content may be changed during program execution
loader
floating-point
beginning
variable
38. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
assignment
identifiers
0
function scope
39. Message displayed to the screen asking user for input; generated with an output statement
#include directive
floating-point
prompt
semicolon
40. A program that finds and attaches to your program the indicated libraries for compilation
Literals
function parameters
preprocessor
sorting
41. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
Stack overflow
register
return
classes
42. A C++ statement that makes a decision is ______.
opened
if
base
cin.get(ch)
43. The stream extraction operator
variable
return
.cpp
>>
44. A function that can be used to read character data including whitespace
cin.get(ch)
NULL
type
showpoint
45. The ________ program transfers the executable image of a C++ program from disk to memory.
loader
subscript (or index)
int values
prompt
46. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
Preprocessor
named constant
&
function prototype
47. A variable that holds the address of another variable.
<<
linker
getline
pointer
48. You can declare default values for a function in the ____________________.
type casting (conversion)
function overloading
fixed
function parameters
49. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
opened
attributes
fstream
50. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
::
binary operator
return
assignment statement