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. __________ can be used to assign an object of a class to another object of the same class.
member
cin >> variable
Default memberwise assignment
strcpy()
2. The process of placing the elements of an array in order is called ________ the array.
comments
Semicolon
recursive function
sorting
3. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
pointer
#include
cin
scope
4. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.
constant variable
preprocessor
/n
inheritance
5. Every C++ program begins execution at the function _________.
classes
main
Preprocessor
token
6. 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.
base class
access specifier
assignment statement
information hiding
7. The _________ begins the body of every function and the _________ ends the body of every function.
if...else
{ }
inheritance
virtual functions
8. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
associations
showpoint
overloading
if...else
9. The _____ causes the contents of another file to be inserted into a program.
heap
semantics
cin
#include directive
10. A ________ program executes before the compiler's translation phase begins.
char
comments
preprocessor
Default memberwise assignment
11. An expression that has operands with different data types
mixed expression
sorting
private
cmath
12. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
searching
pointer
semantics
private
13. Every C++ statement ends with a(n) _________.
semicolon
base class
::
variables
14. Use 2 characters to represent one
escape sequences
fstream
static
vectors
15. The ________ of an identifier is the portion of the program in which the identifier can be used.
{ }
scope
comments
static
16. An operator that can only be used with int values. result will always be an int.
function parameters
% modulus
#include directive
associations
17. Classes can have relationships with other classes. These relationships are called ________.
public
associations
subscript (or index)
//
18. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
linker
global
fixed
19. 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.
arithmetic expression
unary operator
continue
dot (.)
20. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
>>
function scope
ofstream
global
21. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
cin
strcmp()
assignment
22. A human readable file that contains C++ program
opened
base class
source file
linker
23. To write data to a file you define an object of which one of the following
searching
binary operator
function prototype
ofstream
24. A set of values together with a set of operations
attributes
data type
auto
<<
25. A __________ data member represents class-wide information.
static
strlen()
scope
.cpp
26. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
syntax
data type
object file
//
27. A variable that holds the address of another variable.
cin.get(ch)
Closing brace
endl (same as 'n')
pointer
28. int namespace include using return examples of ___________
Sentinel
#include
overloading
reserve words
29. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
type
access specifier
register
const
30. data types that refer to numbers with decimals
pointer
floating-point
stack
semicolon
31. Keyword public is a(n) _________
access specifier
associations
strcmp()
variable
32. Characters used to separate symbols or reserved words or identifiers and statements
function overloading
whitespace
getline
#include directive
33. A filestream variable that represents the default output device
base
derived class
getline
cout
34. Most calculations are normally performed by ______ statements.
assignment
strlen()
member
recursive function
35. Whole numbers - no decimals and no commas included
reserved words
int values
Sentinel
% modulus
36. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
cin.get(ch)
recursive
searching
37. The storage-class specifiers are mutable - auto - ________ - extern and static.
register
default constructor
NULL
strcpy()
38. Class members specified as _________ are accessible anywhere an object of the class is in scope.
fstream
semantics
public
variable
39. The process of analyzing and designing a system from an object-oriented point of view is called ________.
pointer
syntax
cout
object-oriented analysis and design (OOAD)
40. The ________ statement in a called function passes the value of an expression back to the calling function.
return
main
integer operands
cin
41. The idea that you can call the same function and the output will depend on the type of object you're using.
source file
polymorphism
inheritance
if...else
42. A pointer is a variable that contains as its value the____________ of another variable.
vectors
operand value
address
inline functions
43. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
like-type expression
arithmetic expression
token
subscript (or index)
44. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
inline functions
heap
cout
new line
45. A member function should be declared static if it does not access __________ class members.
data type
//
non-static
{ }
46. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
/n
named constant
showpoint
scope resolution operator
47. The sign you use for pointers
*
% modulus
Semicolon
function parameters
48. 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.
information hiding
new line
loader
?
49. Program components in C++ are called functions and ________.
Closing brace
definition
pointer
classes
50. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
function scope
const
sorting
cmath