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 ________ is used to produce random numbers.
like-type expression
rand
unary scope resolution operator (::)
stack
2. A filestream variable that represents the default output device
overloading
template
cout
dot (.)
3. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
overloading
t
source file
function scope
4. An operator that can only be used with int values. result will always be an int.
unary operator
% modulus
>>
int values
5. To write data to a file you define an object of which one of the following
template
ofstream
static_cast<char>(65)
unary operator
6. Compares two strings and returns 0 if they are equal.
static
function prototype
strcmp()
*
7. A function is invoked with a ________.
function call
global
function prototype
#include
8. data types that refer to numbers with decimals
?
.cpp
inline functions
floating-point
9. A file must be ________ before data can be written to or read from it.
constant variable
opened
auto
semicolon
10. Executable version of program
polymorphism
object file
{ }
address
11. All ______ must be declared before they are used.
variables
polymorphism
.cpp
case sensitive
12. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
Stack overflow
identifiers
sorting
cin >> variable
13. A function ________ enables a single function to be defined to perform a task on many different data types.
template
linker
selection
//
14. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
this
identifiers
.cpp
reserved words
15. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
object file
base
token
this
16. You can declare default values for a function in the ____________________.
operator
global
polymorphism
function parameters
17. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
classes
recursive
function overloading
18. __________ can be used to assign an object of a class to another object of the same class.
recursive function
type coercion
Default memberwise assignment
whitespace
19. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function parameters
static_cast<char>(65)
function scope
char
20. 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
base
definition
% modulus
floating-point
21. When a value of one data type is implicitly (automatically) changed to another data type
void pointer
virtual functions
>>
type coercion
22. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
//
const datatype identifier = value
new line
function overloading
23. Keyword public is a(n) _________
function prototype
&
access specifier
member
24. This is used to mark the end of a complete C++ programming statement.
type
operator overloading
>>
Semicolon
25. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
base
const
#include directive
getline
26. A variable declared outside any block or function is a ________ variable.
global
globals
object-oriented analysis and design (OOAD)
break
27. Two slash marks ( // ) indicate __________ of a comment
void
beginning
function overloading
<<
28. All C++ Variables are_________.
if
Stack overflow
setw
case sensitive
29. The address-of operator. it is used to assign pointers and to print the address of variables.
&
preprocessor
access specifier
register
30. Sets floating-point values to a fixed decimal format
strcpy()
type coercion
?
fixed
31. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
inline functions
strcpy()
rand
auto
32. The sign you use for pointers
const datatype identifier = value
*
char
heap
33. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
data type
named constant
auto
34. You must have a ___________ for every variable you intend to use in a program
% modulus
definition
beginning
preprocessor
35. A filestream variable that represents the default input source
cin
case sensitive
::
unary scope resolution operator (::)
36. tab
t
const datatype identifier = value
type casting (conversion)
assignment statement
37. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
endl (same as 'n')
template
n
semantics
38. This manipulator causes the field to be left-justified with padding spaces printed to the right.
void
left
selection
inheritance
39. Used for function calls and local variables
return
stack
/n
cin
40. A constant object must be __________; it cannot be modified after it is created.
#include
Semicolon
initialized
endl (same as 'n')
41. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
pointer
void
if...else
floating-point
42. The process of determining if an array contains a particular key value is called _________ the array.
virtual functions
cin.get(ch)
overloading
searching
43. A __________ should be used to declare the size of an array because it makes the program more scalable.
local variable
if...else
constant variable
fstream
44. Words that are used for special purposes in a program
virtual functions
reserved words
before
Stack overflow
45. * / % + -
srand
left
fstream
Arithmetic Operators
46. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
this
#include directive
Sentinel
if...else
47. Member objects are constructed __________ their enclosing class object.
before
variables
continue
strlen()
48. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
const
this
semicolon
49. Default name of executable file
endl (same as 'n')
a.out
cout
Unified Modeling Language(UML)
50. Symbol that denotes an action to be performed
operator
semicolon
associations
subscript (or index)