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 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.
reserve words
searching
initialized
?
2. Forces the computer to display decimal point and trailing zeroes
integer operands
if
inheritance
showpoint
3. Member objects are constructed __________ their enclosing class object.
two-dimensional
before
Closing brace
#include <headerfilename>
4. 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.
before
semicolon
information hiding
Arithmetic Operators
5. A constant object must be __________; it cannot be modified after it is created.
template
reserved words
assignment statement
initialized
6. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
virtual functions
selection
preprocessor
char
7. The modulus operator (%) can be used only with __________.
static
local variable
>>
integer operands
8. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
new line
Sentinel
inline functions
named constant
9. A human readable file that contains C++ program
cout
constant variable
mixed expression
source file
10. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
<<
register
cout
11. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
default constructor
Unified Modeling Language(UML)
const datatype identifier = value
overloading
12. Operator with only one operand
escape sequences
floating-point
unary operator
variables
13. You must have a ___________ for every variable you intend to use in a program
NULL
vectors
definition
inline functions
14. Every C++ statement ends with a(n) _________.
function scope
semicolon
polymorphism
scope
15. Returns the length of a string excluding the null terminator.
Stack overflow
subscript (or index)
ofstream
strlen()
16. An array that uses two subscripts is referred to as a(n) _________ array.
local variable
void
two-dimensional
semicolon
17. An operator that can only be used with int values. result will always be an int.
Default memberwise assignment
% modulus
globals
const
18. directive A statement that starts with a # is called a ____________.
case sensitive
derived class
int values
Preprocessor
19. * / % + -
sorting
before
Arithmetic Operators
inline functions
20. Classes can have relationships with other classes. These relationships are called ________.
public
private
associations
dot (.)
21. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
Default memberwise assignment
>>
return
function call
22. The _____ causes the contents of another file to be inserted into a program.
before
reserved words
#include directive
inline functions
23. Associate an identifier with a memory location
const datatype identifier = value
allocating memory
whitespace
address
24. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
searching
preprocessor
this
//
25. Naming convention for C++ programs
setw
.cpp
fstream
Stack overflow
26. The stream extraction operator
>>
Counter-controlled or definite
friend
static
27. 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.
operator
assignment
preprocessor
/n
28. Type casting syntax
static_cast<char>(65)
function overloading
.cpp
Counter-controlled or definite
29. A function that calls itself
recursive function
linker
floating-point
vectors
30. 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.
comments
constant variable
switch
dot (.)
31. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
recursive
special symbols
comments
&
32. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
non-static
type
this
function call
33. newline
n
semantics
break
variables
34. A __________ should be used to declare the size of an array because it makes the program more scalable.
strcmp()
searching
before
constant variable
35. 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
function scope
function overloading
source file
36. Used for function calls and local variables
operand value
allocating memory
stack
binary operator
37. Two slash marks ( // ) indicate __________ of a comment
inline functions
if
function prototype
beginning
38. Whole numbers - no decimals and no commas included
recursive
int values
associations
.cpp
39. Syntax for named constant declaration
const datatype identifier = value
/n
&
void
40. Class members specified as _________ are accessible anywhere an object of the class is in scope.
private
stack
public
void
41. This manipulator is used to establish a field width for the value immediately following it.
const
setw
Literals
vectors
42. A variable declared outside any block or function is a ________ variable.
recursive function
global
allocating memory
type coercion
43. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
function overloading
getline
return
preprocessor
44. 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.
virtual functions
t
endl (same as 'n')
linker
45. Function ________ is used to produce random numbers.
polymorphism
case sensitive
rand
::
46. data types that refer to numbers with decimals
integer operands
classes
vectors
floating-point
47. A variable that is known only within the function in which it is defined is called a ________.
0
left
local variable
fstream
48. If a member initializer is not provided for a member object of a class the object's __________ is called.
const
object file
arithmetic expression
default constructor
49. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
inheritance
register
vectors
50. The stream insertion operator
continue
rand
<<
friend