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 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
break
initialized
non-static
2. A memory location with a name and data type - its content may be changed during program execution
cmath
register
getline
variable
3. The address-of operator. it is used to assign pointers and to print the address of variables.
assignment statement
NULL
Preprocessor
&
4. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
attributes
special symbols
constant variable
5. You must have a ___________ for every variable you intend to use in a program
private
?
loader
definition
6. Type casting syntax
static_cast<char>(65)
binary operator
unary operator
const datatype identifier = value
7. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
&
operator overloading
function scope
8. A C++ statement that makes a decision is ______.
recursive
if
globals
scope resolution operator
9. data types that refer to numbers with decimals
ofstream
like-type expression
floating-point
rand
10. The three values that can be used to initialize a pointer are 0 - __________ and an address.
endl (same as 'n')
register
fixed
NULL
11. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
Counter-controlled or definite
continue
attributes
switch
12. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
floating-point
operator overloading
mixed expression
template
13. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
variable
function scope
char
pointer
14. A function that can be used to read character data including whitespace
cin.get(ch)
fstream
address
access specifier
15. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
selection
globals
const
Preprocessor
16. 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.
member
public
endl (same as 'n')
virtual functions
17. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
sorting
new line
strcmp()
Unified Modeling Language(UML)
18. 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.
cin.get(ch)
showpoint
Sentinel
strcpy()
19. Forces the computer to display decimal point and trailing zeroes
register
linker
showpoint
named constant
20. An operator that can only be used with int values. result will always be an int.
main
/n
inline functions
% modulus
21. Classes can have relationships with other classes. These relationships are called ________.
two-dimensional
integer operands
associations
token
22. Grammar rules of the language; compiler will try to identify and locate syntax errors
recursive
syntax
ofstream
strcmp()
23. __________ can be used to assign an object of a class to another object of the same class.
vectors
if...else
information hiding
Default memberwise assignment
24. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
Unified Modeling Language(UML)
scope
if...else
&
25. 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.
unary operator
dot (.)
definition
auto
26. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
auto
void
object-oriented analysis and design (OOAD)
void pointer
27. A filestream variable that represents the default input source
const
static
Unified Modeling Language(UML)
cin
28. A program that finds and attaches to your program the indicated libraries for compilation
?
function parameters
preprocessor
prompt
29. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
definition
main
Literals
30. Most calculations are normally performed by ______ statements.
whitespace
void pointer
mixed expression
assignment
31. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
char
recursive
named constant
const
32. The process of placing the elements of an array in order is called ________ the array.
constant variable
cin >> variable
sorting
Unified Modeling Language(UML)
33. A variable that holds the address of another variable.
default constructor
source file
polymorphism
pointer
34. This is used to mark the end of a complete C++ programming statement.
register
cin
#include <headerfilename>
Semicolon
35. Compares two strings and returns 0 if they are equal.
int values
preprocessor
strcmp()
editor
36. 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.
break
integer operands
editor
?
37. Every C++ program begins execution at the function _________.
main
stack
scope resolution operator
access specifier
38. To allow file access in a program you must #include this header file.
type coercion
Preprocessor
fstream
case sensitive
39. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
void
//
Arithmetic Operators
int values
40. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
editor
inline functions
Stack overflow
41. 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
selection
static_cast<char>(65)
opened
42. When a value of one data type is implicitly (automatically) changed to another data type
Semicolon
subscript (or index)
constant variable
type coercion
43. The ________ statement in a called function passes the value of an expression back to the calling function.
return
preprocessor
vectors
Preprocessor
44. Class members specified as _________ are accessible anywhere an object of the class is in scope.
.cpp
non-static
if...else
public
45. The stream insertion operator
<<
recursive
rand
left
46. A ________ program executes before the compiler's translation phase begins.
strcmp()
type
preprocessor
register
47. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
Semicolon
member
#include
recursive
48. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.
static
information hiding
//
function scope
49. Used for function calls and local variables
classes
special symbols
stack
inline functions
50. Repeating a set of instructions a specific number of times is called_________repetition.
Counter-controlled or definite
showpoint
polymorphism
0