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. Preprocessor directive syntax
floating-point
syntax
#include <headerfilename>
cin.get(ch)
2. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
Stack overflow
return
editor
left
3. Repeating a set of instructions a specific number of times is called_________repetition.
floating-point
initialized
Counter-controlled or definite
strcpy()
4. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
global
linker
object-oriented analysis and design (OOAD)
5. Symbol that denotes an action to be performed
>>
Stack overflow
data type
operator
6. A member function should be declared static if it does not access __________ class members.
&
non-static
unary operator
setw
7. These are data items whose values do not change while the program is running
mixed expression
Literals
friend
private
8. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
comments
fixed
named constant
9. All C++ Variables are_________.
void pointer
case sensitive
srand
::
10. An expression that has operands with different data types
function call
mixed expression
% modulus
inline functions
11. Operator with only one operand
t
/n
unary operator
floating-point
12. The elements of an array are related by the fact that they have the same name and ___________.
access specifier
auto
source file
type
13. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
int values
semantics
new line
inheritance
14. A human readable file that contains C++ program
<<
source file
prompt
cin
15. directive A statement that starts with a # is called a ____________.
global
getline
Preprocessor
endl (same as 'n')
16. Compares two strings and returns 0 if they are equal.
<<
strcmp()
assignment statement
base class
17. 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.
Sentinel
cin
sorting
global
18. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
//
if...else
>>
19. Function ________ is used to produce random numbers.
default constructor
register
template
rand
20. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
n
break
#include
scope
21. int namespace include using return examples of ___________
a.out
reserve words
if...else
before
22. The __________ operator reclaims memory previously allocated by new.
polymorphism
two-dimensional
strcpy()
delete
23. A filestream variable that represents the default input source
const datatype identifier = value
fstream
&
cin
24. Keyword public is a(n) _________
floating-point
access specifier
operand value
switch
25. Most calculations are normally performed by ______ statements.
base class
void
assignment
type coercion
26. Initializers __________ must be used to initialize constant members of a class.
semicolon
<<
operator
member
27. Characters used to separate symbols or reserved words or identifiers and statements
cin >> variable
inheritance
whitespace
derived class
28. A __________ should be used to declare the size of an array because it makes the program more scalable.
register
constant variable
cout
Default memberwise assignment
29. A function that can be used to read character data including whitespace
endl (same as 'n')
if
local variable
cin.get(ch)
30. This manipulator causes the field to be left-justified with padding spaces printed to the right.
friend
left
token
endl (same as 'n')
31. A type of pointer that can point at objects of any data type.
assignment
//
reserved words
void pointer
32. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
pointer
opened
function scope
fstream
33. A constant object must be __________; it cannot be modified after it is created.
this
a.out
initialized
searching
34. Returns the length of a string excluding the null terminator.
opened
if
strlen()
data type
35. To explicitly indicate that a value is to be converted to another type
Counter-controlled or definite
type casting (conversion)
Literals
static_cast<char>(65)
36. Syntax for named constant declaration
const datatype identifier = value
Semicolon
/n
function prototype
37. A C++ statement that makes a decision is ______.
associations
vectors
if
recursive function
38. The sign you use for pointers
information hiding
{ }
*
object file
39. Lists and tables of values can be stored in arrays or __________.
switch
default constructor
inheritance
vectors
40. Member objects are constructed __________ their enclosing class object.
switch
before
virtual functions
Preprocessor
41. The stream insertion operator
type coercion
::
default constructor
<<
42. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
cout
cin
char
left
43. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
operator overloading
named constant
srand
semantics
44. tab
::
continue
t
{ }
45. Identifier or expression that is part of the calculation to be performed
operand value
break
::
preprocessor
46. The symbol for the binary scope resolution operator
cin.get(ch)
#include <headerfilename>
Default memberwise assignment
::
47. Use 2 characters to represent one
new line
preprocessor
escape sequences
break
48. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
operator overloading
Literals
strlen()
49. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
type
//
selection
operand value
50. A filestream variable that represents the default output device
cout
strcpy()
special symbols
void