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. Nonexecutable statements that are included in a program to provide information about what the program does etc.
comments
srand
access specifier
showpoint
2. A function is invoked with a ________.
void pointer
{ }
function call
this
3. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
classes
source file
unary operator
4. A function that can be used to read character data including whitespace
cin.get(ch)
return
rand
assignment
5. This manipulator causes the field to be left-justified with padding spaces printed to the right.
srand
Default memberwise assignment
left
#include directive
6. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
function overloading
information hiding
floating-point
7. 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.
fixed
void
0
Sentinel
8. Used for function calls and local variables
>>
::
private
stack
9. The ________ program combines the output of the compiler with various library functions to produce an executable image.
linker
whitespace
% modulus
definition
10. The modulus operator (%) can be used only with __________.
integer operands
associations
globals
subscript (or index)
11. Keyword public is a(n) _________
access specifier
constant variable
address
virtual functions
12. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
address
cin >> variable
new line
getline
13. Symbol that denotes an action to be performed
operator
cin.get(ch)
variables
::
14. The symbol for the binary scope resolution operator
globals
::
inheritance
selection
15. Classes can have relationships with other classes. These relationships are called ________.
Semicolon
register
associations
linker
16. Words that are used for special purposes in a program
whitespace
strcmp()
reserved words
public
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.
function overloading
break
cin
overloading
18. In inheritance the ____________ is the class the receives the inherited members.
classes
derived class
rand
this
19. A file must be ________ before data can be written to or read from it.
named constant
opened
&
function overloading
20. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
pointer
comments
vectors
const
21. Function ________ is used to produce random numbers.
constant variable
like-type expression
rand
<<
22. The stream insertion operator
strlen()
operand value
<<
sorting
23. This is used to mark the end of a complete C++ programming statement.
getline
linker
Semicolon
delete
24. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
dot (.)
assignment
preprocessor
friend
25. These are data items whose values do not change while the program is running
endl (same as 'n')
base
//
Literals
26. To allow file access in a program you must #include this header file.
rand
escape sequences
fixed
fstream
27. Preprocessor directive syntax
binary operator
#include <headerfilename>
0
comments
28. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
% modulus
named constant
int values
this
29. A constant object must be __________; it cannot be modified after it is created.
void pointer
initialized
inheritance
endl (same as 'n')
30. The process of analyzing and designing a system from an object-oriented point of view is called ________.
*
cin >> variable
virtual functions
object-oriented analysis and design (OOAD)
31. All C++ Variables are_________.
char
if...else
main
case sensitive
32. A memory location with a name and data type - its content may be changed during program execution
address
rand
variable
initialized
33. The ________ qualifier is used to declare read-only variables.
pointer
const
.cpp
reserve words
34. An expression in which all operands have the same data type - result will have the same data type as operands
?
private
like-type expression
dot (.)
35. Every C++ statement ends with a(n) _________.
auto
showpoint
semicolon
non-static
36. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
function parameters
vectors
recursive
derived class
37. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
floating-point
subscript (or index)
left
switch
38. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
new line
::
return
member
39. Syntax for named constant declaration
const datatype identifier = value
pointer
allocating memory
switch
40. Operator with two operands
base class
binary operator
main
preprocessor
41. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
inheritance
this
token
default constructor
42. A type of pointer that can point at objects of any data type.
derived class
type casting (conversion)
void pointer
#include directive
43. Operator with only one operand
binary operator
unary operator
ofstream
static
44. The _________ begins the body of every function and the _________ ends the body of every function.
template
return
Unified Modeling Language(UML)
{ }
45. The sign you use for references
associations
two-dimensional
&
operand value
46. A variable declared outside any block or function is a ________ variable.
global
virtual functions
preprocessor
switch
47. You must have a ___________ for every variable you intend to use in a program
pointer
definition
type coercion
integer operands
48. A ________ program executes before the compiler's translation phase begins.
0
fstream
preprocessor
object file
49. int namespace include using return examples of ___________
reserve words
n
if...else
Stack overflow
50. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
Stack overflow
?
Preprocessor
type coercion