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. Syntax for named constant declaration
main
const datatype identifier = value
object file
recursive
2. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
prompt
<<
Unified Modeling Language(UML)
assignment statement
3. A sequence of operands and operators that describe a calculation to be performed
arithmetic expression
special symbols
const datatype identifier = value
editor
4. Identifier or expression that is part of the calculation to be performed
Unified Modeling Language(UML)
pointer
polymorphism
operand value
5. C++ programs are normally typed into a computer using a(n) ________ program.
editor
object-oriented analysis and design (OOAD)
recursive function
linker
6. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
classes
::
if...else
operator overloading
7. A function that calls itself
recursive function
void
object file
return
8. = & | are examples of ____________.
recursive
special symbols
global
selection
9. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
recursive
friend
special symbols
virtual functions
10. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
break
initialized
constant variable
overloading
11. The stream extraction operator
switch
escape sequences
semicolon
>>
12. The ________ statement in a called function passes the value of an expression back to the calling function.
assignment statement
syntax
return
whitespace
13. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
*
main
delete
getline
14. Program components in C++ are called functions and ________.
/n
classes
strcpy()
beginning
15. Operator with only one operand
member
unary operator
address
preprocessor
16. The symbol for the binary scope resolution operator
::
floating-point
&
#include <headerfilename>
17. The storage-class specifiers are mutable - auto - ________ - extern and static.
public
polymorphism
identifiers
register
18. 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
allocating memory
data type
base
static
19. A file must be ________ before data can be written to or read from it.
::
.cpp
opened
strcpy()
20. If a member initializer is not provided for a member object of a class the object's __________ is called.
default constructor
base class
variable
address
21. Words that are used for special purposes in a program
strcmp()
&
reserved words
default constructor
22. __________ can be used to assign an object of a class to another object of the same class.
Semicolon
delete
sorting
Default memberwise assignment
23. An expression in which all operands have the same data type - result will have the same data type as operands
address
static_cast<char>(65)
cout
like-type expression
24. * / % + -
Arithmetic Operators
Unified Modeling Language(UML)
.cpp
comments
25. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
assignment
#include directive
virtual functions
26. Classes can have relationships with other classes. These relationships are called ________.
register
associations
inline functions
overloading
27. A memory location with a name and data type - its content may be changed during program execution
private
variable
ofstream
Counter-controlled or definite
28. To allow file access in a program you must #include this header file.
binary operator
showpoint
whitespace
fstream
29. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
inheritance
base
sorting
virtual functions
30. Grammar rules of the language; compiler will try to identify and locate syntax errors
cin >> variable
function prototype
/n
syntax
31. 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.
const datatype identifier = value
information hiding
&
switch
32. Forces the computer to display decimal point and trailing zeroes
showpoint
scope resolution operator
Stack overflow
endl (same as 'n')
33. A type of pointer that can point at objects of any data type.
break
semantics
void pointer
{ }
34. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
private
globals
recursive function
identifiers
35. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
/n
*
Counter-controlled or definite
switch
36. Compares two strings and returns 0 if they are equal.
pointer
strcmp()
unary scope resolution operator (::)
linker
37. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
this
virtual functions
whitespace
mixed expression
38. data types that refer to numbers with decimals
floating-point
preprocessor
void
?
39. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
fstream
?
base
function overloading
40. 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.
editor
definition
/n
whitespace
41. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
inheritance
searching
return
0
42. Initializers __________ must be used to initialize constant members of a class.
definition
member
type coercion
syntax
43. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
#include
derived class
operator overloading
globals
44. Returns the length of a string excluding the null terminator.
pointer
strlen()
{ }
rand
45. 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.
cout
preprocessor
dot (.)
prompt
46. Names of things that are used in a program - can apply to variables & constants and functions
*
getline
identifiers
strlen()
47. You must have a ___________ for every variable you intend to use in a program
Closing brace
cin >> variable
definition
cout
48. Creates a copy of a string.
floating-point
strcpy()
arithmetic expression
polymorphism
49. Whole numbers - no decimals and no commas included
int values
?
const datatype identifier = value
void pointer
50. The _____ causes the contents of another file to be inserted into a program.
main
#include directive
Default memberwise assignment
new line