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. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
#include directive
variable
private
2. The ________ qualifier is used to declare read-only variables.
const
cmath
special symbols
>>
3. A ________ program executes before the compiler's translation phase begins.
preprocessor
cmath
access specifier
scope
4. Names of things that are used in a program - can apply to variables & constants and functions
this
public
inline functions
identifiers
5. directive A statement that starts with a # is called a ____________.
cin
const datatype identifier = value
Preprocessor
void
6. A pointer is a variable that contains as its value the____________ of another variable.
address
function prototype
overloading
% modulus
7. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
source file
if
token
syntax
8. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
void
fstream
a.out
9. data types that refer to numbers with decimals
::
floating-point
function parameters
pointer
10. Syntax for named constant declaration
const datatype identifier = value
cin >> variable
cmath
new line
11. A variable that holds the address of another variable.
access specifier
pointer
mixed expression
recursive
12. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
integer operands
strcpy()
function parameters
globals
13. 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.
searching
Sentinel
comments
Literals
14. Class members specified as _________ are accessible anywhere an object of the class is in scope.
public
named constant
function call
void pointer
15. The symbol for the binary scope resolution operator
definition
data type
::
before
16. The size & shape & color and weight of an object are considered
pointer
unary scope resolution operator (::)
preprocessor
attributes
17. For every opening brace in a C++ program there must be a ______________.
Closing brace
static_cast<char>(65)
classes
operand value
18. An operator that can only be used with int values. result will always be an int.
Arithmetic Operators
like-type expression
recursive function
% modulus
19. The three values that can be used to initialize a pointer are 0 - __________ and an address.
member
void pointer
public
NULL
20. This manipulator causes the field to be left-justified with padding spaces printed to the right.
Literals
object file
Preprocessor
left
21. The ________ statement in a called function passes the value of an expression back to the calling function.
type coercion
return
address
&
22. Classes can have relationships with other classes. These relationships are called ________.
*
case sensitive
associations
prompt
23. 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.
assignment
named constant
delete
static
24. Words that are used for special purposes in a program
private
if
opened
reserved words
25. Forces the computer to display decimal point and trailing zeroes
scope resolution operator
showpoint
break
endl (same as 'n')
26. 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
new line
base
reserved words
Closing brace
27. Creates a copy of a string.
% modulus
strcpy()
dot (.)
operator overloading
28. A C++ statement that makes a decision is ______.
a.out
return
function call
if
29. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
variable
?
classes
cin
30. A function is invoked with a ________.
polymorphism
beginning
function scope
function call
31. Initializers __________ must be used to initialize constant members of a class.
pointer
recursive function
member
Closing brace
32. Allows the programmer to store a value in a variable
assignment statement
% modulus
unary operator
base class
33. The sign you use for pointers
Default memberwise assignment
#include <headerfilename>
char
*
34. A set of values together with a set of operations
classes
before
prompt
data type
35. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
static
assignment
switch
register
36. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
rand
switch
whitespace
private
37. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
return
private
allocating memory
Stack overflow
38. C++ programs are normally typed into a computer using a(n) ________ program.
static_cast<char>(65)
editor
Arithmetic Operators
main
39. The elements of an array are related by the fact that they have the same name and ___________.
vectors
sorting
type
preprocessor
40. Keyword public is a(n) _________
access specifier
break
named constant
editor
41. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
Preprocessor
named constant
getline
42. Characters used to separate symbols or reserved words or identifiers and statements
classes
#include directive
whitespace
allocating memory
43. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
endl (same as 'n')
searching
scope
44. The ________ of an identifier is the portion of the program in which the identifier can be used.
classes
int values
scope
private
45. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
this
cin
binary operator
assignment
46. Member objects are constructed __________ their enclosing class object.
Sentinel
type casting (conversion)
before
n
47. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
function overloading
private
cin >> variable
named constant
48. Symbol that denotes an action to be performed
.cpp
constant variable
searching
operator
49. int namespace include using return examples of ___________
reserve words
vectors
fixed
searching
50. The _____ causes the contents of another file to be inserted into a program.
friend
#include directive
token
two-dimensional