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. The address-of operator. it is used to assign pointers and to print the address of variables.
operand value
this
&
if...else
2. 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
preprocessor
static
loader
3. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
/n
local variable
global
4. A type of pointer that can point at objects of any data type.
if...else
void pointer
return
associations
5. 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 (.)
constant variable
classes
overloading
6. * / % + -
beginning
Arithmetic Operators
rand
void
7. A file must be ________ before data can be written to or read from it.
fstream
opened
mixed expression
vectors
8. Names of things that are used in a program - can apply to variables & constants and functions
endl (same as 'n')
pointer
identifiers
prompt
9. Use 2 characters to represent one
//
getline
escape sequences
switch
10. An array that uses two subscripts is referred to as a(n) _________ array.
delete
two-dimensional
Stack overflow
opened
11. A program that finds and attaches to your program the indicated libraries for compilation
continue
preprocessor
void pointer
if...else
12. Every C++ statement ends with a(n) _________.
semicolon
{ }
data type
<<
13. The ________ of an identifier is the portion of the program in which the identifier can be used.
0
left
linker
scope
14. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call
base
semantics
function prototype
preprocessor
15. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
initialized
assignment statement
register
mixed expression
16. This is used to mark the end of a complete C++ programming statement.
break
if
friend
Semicolon
17. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
break
a.out
cin.get(ch)
special symbols
18. A member function should be declared static if it does not access __________ class members.
object file
main
non-static
unary operator
19. data types that refer to numbers with decimals
cin >> variable
floating-point
semicolon
if
20. directive A statement that starts with a # is called a ____________.
return
semantics
Preprocessor
searching
21. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
preprocessor
getline
polymorphism
recursive function
22. Two slash marks ( // ) indicate __________ of a comment
inheritance
scope
operand value
beginning
23. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
stack
before
assignment
private
24. The symbol for the binary scope resolution operator
if
operator
::
#include directive
25. Every C++ program begins execution at the function _________.
like-type expression
recursive function
main
return
26. Operator with two operands
local variable
special symbols
binary operator
globals
27. The process of placing the elements of an array in order is called ________ the array.
void
sorting
initialized
switch
28. Most calculations are normally performed by ______ statements.
globals
inline functions
type coercion
assignment
29. int namespace include using return examples of ___________
setw
void pointer
reserve words
strlen()
30. Returns the length of a string excluding the null terminator.
void
function prototype
binary operator
strlen()
31. Compares two strings and returns 0 if they are equal.
variables
arithmetic expression
strcmp()
break
32. To write data to a file you define an object of which one of the following
ofstream
<<
fstream
function prototype
33. The stream extraction operator
>>
cin.get(ch)
endl (same as 'n')
token
34. The modulus operator (%) can be used only with __________.
scope
integer operands
private
mixed expression
35. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
friend
semantics
const
::
36. A function is invoked with a ________.
syntax
function call
comments
overloading
37. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
getline
//
syntax
function parameters
38. These are data items whose values do not change while the program is running
object file
stack
escape sequences
Literals
39. Message displayed to the screen asking user for input; generated with an output statement
prompt
Preprocessor
endl (same as 'n')
*
40. 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.
showpoint
whitespace
integer operands
?
41. For every opening brace in a C++ program there must be a ______________.
allocating memory
operator
left
Closing brace
42. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
function call
sorting
#include
?
43. All ______ must be declared before they are used.
variables
break
overloading
::
44. An expression that has operands with different data types
mixed expression
global
cin >> variable
searching
45. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
&
private
named constant
46. Type casting syntax
static_cast<char>(65)
initialized
linker
Unified Modeling Language(UML)
47. The _________ begins the body of every function and the _________ ends the body of every function.
getline
operator overloading
{ }
virtual functions
48. A function ________ enables a single function to be defined to perform a task on many different data types.
&
if
template
strlen()
49. Allows the programmer to store a value in a variable
public
assignment statement
void
srand
50. The process of determining if an array contains a particular key value is called _________ the array.
mixed expression
searching
left
const