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 idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
base class
Arithmetic Operators
cin.get(ch)
2. Class members specified as _________ are accessible anywhere an object of the class is in scope.
cin.get(ch)
public
access specifier
static
3. Two slash marks ( // ) indicate __________ of a comment
sorting
beginning
::
operand value
4. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
auto
associations
initialized
recursive
5. Repeating a set of instructions a specific number of times is called_________repetition.
void
floating-point
recursive
Counter-controlled or definite
6. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
NULL
local variable
initialized
char
7. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
globals
linker
this
overloading
8. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
Semicolon
.cpp
Default memberwise assignment
9. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
mixed expression
this
Literals
10. Symbol that denotes an action to be performed
operator
Preprocessor
pointer
globals
11. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
polymorphism
Arithmetic Operators
identifiers
12. tab
sorting
NULL
semantics
t
13. Type casting syntax
delete
srand
static_cast<char>(65)
Default memberwise assignment
14. 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.
Unified Modeling Language(UML)
case sensitive
function overloading
dot (.)
15. Creates a copy of a string.
int values
strcpy()
endl (same as 'n')
void
16. Returns the length of a string excluding the null terminator.
*
cin.get(ch)
strlen()
integer operands
17. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
heap
showpoint
a.out
18. Function ________ is used to produce random numbers.
rand
ofstream
showpoint
classes
19. A function ________ enables a single function to be defined to perform a task on many different data types.
type coercion
default constructor
void pointer
template
20. In inheritance the ____________ is the class the receives the inherited members.
ofstream
derived class
pointer
attributes
21. You can declare default values for a function in the ____________________.
strcmp()
function parameters
whitespace
access specifier
22. int namespace include using return examples of ___________
case sensitive
register
NULL
reserve words
23. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
.cpp
friend
base class
>>
24. The process of analyzing and designing a system from an object-oriented point of view is called ________.
void
switch
register
object-oriented analysis and design (OOAD)
25. Keyword public is a(n) _________
opened
Counter-controlled or definite
access specifier
polymorphism
26. Most calculations are normally performed by ______ statements.
if
<<
access specifier
assignment
27. A ________ program executes before the compiler's translation phase begins.
t
preprocessor
this
private
28. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
0
semantics
new line
classes
29. Naming convention for C++ programs
opened
data type
.cpp
unary scope resolution operator (::)
30. A filestream variable that represents the default output device
special symbols
function call
case sensitive
cout
31. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.
static
syntax
<<
object file
32. C++ programs are normally typed into a computer using a(n) ________ program.
editor
Preprocessor
information hiding
operator overloading
33. A function is invoked with a ________.
function call
access specifier
constant variable
comments
34. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
void pointer
unary scope resolution operator (::)
function scope
data type
35. Every C++ program begins execution at the function _________.
delete
t
main
semicolon
36. Compares two strings and returns 0 if they are equal.
fstream
function parameters
strcmp()
loader
37. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
opened
whitespace
source file
break
38. The ________ program combines the output of the compiler with various library functions to produce an executable image.
endl (same as 'n')
linker
delete
two-dimensional
39. A memory location with a name and data type - its content may be changed during program execution
member
endl (same as 'n')
function prototype
variable
40. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
n
//
Default memberwise assignment
41. Executable version of program
object file
associations
auto
searching
42. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
continue
function parameters
semicolon
reserve words
43. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
a.out
classes
showpoint
public
44. Syntax for named constant declaration
auto
associations
recursive
const datatype identifier = value
45. Used to qualify hidden names so that they can be used.
function scope
static_cast<char>(65)
function call
scope resolution operator
46. A variable declared outside any block or function is a ________ variable.
default constructor
Arithmetic Operators
classes
global
47. A set of values together with a set of operations
recursive function
data type
globals
% modulus
48. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
const
auto
#include
static_cast<char>(65)
49. The sign you use for references
fstream
if...else
&
integer operands
50. To allow file access in a program you must #include this header file.
fstream
fixed
pointer
inline functions