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. A variable that is known only within the function in which it is defined is called a ________.
&
function scope
if
local variable
2. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
auto
return
inline functions
floating-point
3. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
object file
semantics
register
4. A function that can be used to read character data including whitespace
non-static
#include
cin.get(ch)
stack
5. Keyword public is a(n) _________
access specifier
special symbols
% modulus
break
6. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
strcpy()
type coercion
access specifier
7. Every C++ statement ends with a(n) _________.
polymorphism
char
initialized
semicolon
8. In inheritance the ____________ is the class that supplies the inherited members.
recursive
semantics
scope resolution operator
base class
9. Header file that contains commonly performed mathematical functions
cin >> variable
operator overloading
cmath
ofstream
10. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
&
recursive
recursive function
pointer
11. A ________ program executes before the compiler's translation phase begins.
cmath
preprocessor
continue
inline functions
12. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
break
binary operator
special symbols
unary operator
13. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
*
vectors
const
% modulus
14. A member function should be declared static if it does not access __________ class members.
inline functions
const
non-static
if...else
15. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
new line
overloading
main
register
16. 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.
if...else
information hiding
allocating memory
syntax
17. The symbol for the binary scope resolution operator
classes
register
::
reserve words
18. Default name of executable file
dot (.)
a.out
initialized
void
19. A memory location with a name and data type - its content may be changed during program execution
token
variable
Preprocessor
::
20. A pointer is a variable that contains as its value the____________ of another variable.
vectors
address
endl (same as 'n')
if...else
21. The number used to refer to a particular element of an array is called its ________.
static_cast<char>(65)
subscript (or index)
default constructor
int values
22. You must have a ___________ for every variable you intend to use in a program
pointer
strcmp()
t
definition
23. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
polymorphism
selection
token
24. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semicolon
virtual functions
srand
semantics
25. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
variables
Arithmetic Operators
void
Stack overflow
26. The size & shape & color and weight of an object are considered
#include <headerfilename>
attributes
base class
Closing brace
27. data types that refer to numbers with decimals
floating-point
>>
initialized
mixed expression
28. The ________ statement in a called function passes the value of an expression back to the calling function.
vectors
return
Semicolon
void pointer
29. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
#include
return
if...else
30. * / % + -
*
beginning
friend
Arithmetic Operators
31. Classes can have relationships with other classes. These relationships are called ________.
pointer
information hiding
associations
strlen()
32. A set of values together with a set of operations
&
floating-point
data type
showpoint
33. tab
stack
t
public
switch
34. This is used to mark the end of a complete C++ programming statement.
Semicolon
register
/n
dot (.)
35. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
<<
endl (same as 'n')
beginning
36. A variable declared outside any block or function is a ________ variable.
searching
arithmetic expression
operator
global
37. A constant object must be __________; it cannot be modified after it is created.
::
Literals
initialized
assignment statement
38. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
polymorphism
derived class
mixed expression
token
39. Compares two strings and returns 0 if they are equal.
strcmp()
floating-point
heap
preprocessor
40. This manipulator is used to establish a field width for the value immediately following it.
setw
private
function prototype
char
41. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
classes
reserve words
getline
preprocessor
42. When a value of one data type is implicitly (automatically) changed to another data type
cin >> variable
friend
type coercion
variable
43. You can declare default values for a function in the ____________________.
function parameters
n
default constructor
function prototype
44. directive A statement that starts with a # is called a ____________.
t
Preprocessor
reserve words
object file
45. A function is invoked with a ________.
delete
a.out
address
function call
46. A function that calls itself
cin >> variable
recursive function
token
integer operands
47. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
editor
Counter-controlled or definite
constant variable
48. A filestream variable that represents the default output device
public
cout
pointer
strcmp()
49. = & | are examples of ____________.
t
prompt
special symbols
classes
50. Names of things that are used in a program - can apply to variables & constants and functions
Unified Modeling Language(UML)
function prototype
identifiers
return