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. This manipulator causes the field to be left-justified with padding spaces printed to the right.
left
int values
?
{ }
2. The three values that can be used to initialize a pointer are 0 - __________ and an address.
a.out
ofstream
NULL
cout
3. A member function should be declared static if it does not access __________ class members.
attributes
allocating memory
public
non-static
4. A filestream variable that represents the default output device
arithmetic expression
unary scope resolution operator (::)
cout
operand value
5. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
?
{ }
escape sequences
6. The symbol for the binary scope resolution operator
::
source file
base
address
7. Compares two strings and returns 0 if they are equal.
attributes
strcmp()
before
a.out
8. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
case sensitive
#include
arithmetic expression
9. The __________ operator reclaims memory previously allocated by new.
main
Literals
delete
Arithmetic Operators
10. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
case sensitive
#include
recursive function
11. A function that calls itself
setw
::
object-oriented analysis and design (OOAD)
recursive function
12. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
setw
preprocessor
recursive
13. To explicitly indicate that a value is to be converted to another type
rand
linker
type casting (conversion)
object-oriented analysis and design (OOAD)
14. In inheritance the ____________ is the class that supplies the inherited members.
assignment
preprocessor
recursive
base class
15. Two slash marks ( // ) indicate __________ of a comment
beginning
ofstream
char
type coercion
16. The process of analyzing and designing a system from an object-oriented point of view is called ________.
left
Unified Modeling Language(UML)
object-oriented analysis and design (OOAD)
const datatype identifier = value
17. A C++ statement that makes a decision is ______.
char
if
cin.get(ch)
*
18. A type of pointer that can point at objects of any data type.
continue
a.out
void pointer
function scope
19. The sign you use for pointers
*
Closing brace
cin >> variable
Arithmetic Operators
20. The ________ enables access to a global variable with the same name as a variable in the current scope.
srand
strcpy()
ofstream
unary scope resolution operator (::)
21. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
semantics
void
Unified Modeling Language(UML)
stack
22. Grammar rules of the language; compiler will try to identify and locate syntax errors
auto
static_cast<char>(65)
syntax
% modulus
23. An operator that can only be used with int values. result will always be an int.
n
scope
*
% modulus
24. Naming convention for C++ programs
.cpp
named constant
reserved words
delete
25. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
source file
static_cast<char>(65)
beginning
pointer
26. Used for function calls and local variables
default constructor
t
{ }
stack
27. Syntax for named constant declaration
const datatype identifier = value
operand value
comments
#include directive
28. The process of placing the elements of an array in order is called ________ the array.
sorting
template
register
address
29. 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.
associations
Sentinel
% modulus
auto
30. 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
Arithmetic Operators
special symbols
selection
31. Program components in C++ are called functions and ________.
recursive
operand value
classes
syntax
32. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
register
this
fixed
/n
33. 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.
reserved words
operand value
information hiding
left
34. A set of values together with a set of operations
virtual functions
data type
fixed
showpoint
35. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
selection
#include <headerfilename>
overloading
reserved words
36. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
overloading
private
inheritance
char
37. Initializers __________ must be used to initialize constant members of a class.
recursive
NULL
member
operand value
38. Every C++ program begins execution at the function _________.
sorting
main
&
Preprocessor
39. To write data to a file you define an object of which one of the following
ofstream
operator overloading
Preprocessor
pointer
40. Associate an identifier with a memory location
two-dimensional
stack
assignment statement
allocating memory
41. The address-of operator. it is used to assign pointers and to print the address of variables.
left
friend
&
operand value
42. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
Stack overflow
prompt
escape sequences
break
43. All C++ Variables are_________.
case sensitive
Preprocessor
Sentinel
subscript (or index)
44. Lists and tables of values can be stored in arrays or __________.
private
polymorphism
void
vectors
45. Words that are used for special purposes in a program
default constructor
Preprocessor
reserved words
a.out
46. Header file that contains commonly performed mathematical functions
const datatype identifier = value
cmath
object file
non-static
47. Creates a copy of a string.
strcpy()
NULL
data type
reserved words
48. When a value of one data type is implicitly (automatically) changed to another data type
like-type expression
Semicolon
break
type coercion
49. A memory location with a name and data type - its content may be changed during program execution
continue
auto
register
variable
50. An array that uses two subscripts is referred to as a(n) _________ array.
variables
floating-point
operator
two-dimensional