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. Symbol that denotes an action to be performed
selection
definition
arithmetic expression
operator
2. The sign you use for references
Sentinel
assignment
&
fstream
3. An expression that has operands with different data types
editor
register
function call
mixed expression
4. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
&
getline
Arithmetic Operators
scope resolution operator
5. A filestream variable that represents the default output device
cout
srand
setw
subscript (or index)
6. The elements of an array are related by the fact that they have the same name and ___________.
break
type
mixed expression
<<
7. The sign you use for pointers
return
*
overloading
definition
8. The ________ statement in a called function passes the value of an expression back to the calling function.
operator
return
cout
prompt
9. __________ can be used to assign an object of a class to another object of the same class.
base class
register
variable
Default memberwise assignment
10. The stream insertion operator
whitespace
<<
Semicolon
like-type expression
11. Classes can have relationships with other classes. These relationships are called ________.
member
definition
associations
function prototype
12. The size & shape & color and weight of an object are considered
assignment
attributes
stack
floating-point
13. These are data items whose values do not change while the program is running
Literals
assignment statement
recursive
integer operands
14. A human readable file that contains C++ program
source file
variables
preprocessor
comments
15. Sets floating-point values to a fixed decimal format
fixed
binary operator
Counter-controlled or definite
pointer
16. 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.
endl (same as 'n')
scope
dot (.)
Preprocessor
17. Returns the length of a string excluding the null terminator.
beginning
strlen()
continue
operand value
18. 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.
/n
Literals
return
token
19. A function that can be used to read character data including whitespace
editor
default constructor
rand
cin.get(ch)
20. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
&
initialized
.cpp
return
21. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
inline functions
source file
register
22. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
Stack overflow
unary scope resolution operator (::)
subscript (or index)
23. Allows the programmer to store a value in a variable
object file
template
heap
assignment statement
24. Header file that contains commonly performed mathematical functions
cin
cmath
Literals
before
25. In inheritance the ____________ is the class that supplies the inherited members.
int values
pointer
linker
base class
26. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
27. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
<<
#include directive
unary scope resolution operator (::)
28. The _____ causes the contents of another file to be inserted into a program.
mixed expression
left
derived class
#include directive
29. = & | are examples of ____________.
special symbols
virtual functions
escape sequences
Preprocessor
30. Program components in C++ are called functions and ________.
function parameters
semantics
overloading
classes
31. Naming convention for C++ programs
.cpp
local variable
base
comments
32. 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.
Closing brace
Sentinel
scope
continue
33. A variable that is known only within the function in which it is defined is called a ________.
stack
two-dimensional
local variable
inheritance
34. Every C++ program begins execution at the function _________.
*
Counter-controlled or definite
derived class
main
35. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
semicolon
pointer
char
sorting
36. The symbol for the binary scope resolution operator
escape sequences
mixed expression
friend
::
37. All ______ must be declared before they are used.
unary operator
*
variables
function prototype
38. If a member initializer is not provided for a member object of a class the object's __________ is called.
heap
static
void
default constructor
39. The __________ operator reclaims memory previously allocated by new.
virtual functions
delete
Closing brace
strcmp()
40. Creates a copy of a string.
strcpy()
type casting (conversion)
floating-point
cin.get(ch)
41. This manipulator is used to establish a field width for the value immediately following it.
#include <headerfilename>
//
endl (same as 'n')
setw
42. Words that are used for special purposes in a program
Closing brace
reserved words
whitespace
srand
43. A set of values together with a set of operations
/n
object-oriented analysis and design (OOAD)
static_cast<char>(65)
data type
44. 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.
public
information hiding
type casting (conversion)
fixed
45. The ________ of an identifier is the portion of the program in which the identifier can be used.
return
reserved words
function parameters
scope
46. Type casting syntax
static_cast<char>(65)
fixed
&
cout
47. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
rand
strcpy()
attributes
break
48. The only integer that can be assigned directly to a pointer is_____________.
0
a.out
binary operator
n
49. A pointer is a variable that contains as its value the____________ of another variable.
const datatype identifier = value
assignment statement
Arithmetic Operators
address
50. Function ________ is used to produce random numbers.
?
source file
rand
assignment