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 keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
operand value
Literals
NULL
void
2. When a value of one data type is implicitly (automatically) changed to another data type
strcpy()
variables
type coercion
>>
3. The storage-class specifiers are mutable - auto - ________ - extern and static.
type
before
char
register
4. Operator with two operands
private
binary operator
a.out
char
5. A program that finds and attaches to your program the indicated libraries for compilation
preprocessor
friend
sorting
break
6. 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
7. The _________ begins the body of every function and the _________ ends the body of every function.
base
{ }
cin
return
8. An expression that has operands with different data types
semantics
mixed expression
reserve words
special symbols
9. The ________ of an identifier is the portion of the program in which the identifier can be used.
assignment statement
scope
assignment
register
10. Member objects are constructed __________ their enclosing class object.
left
% modulus
before
inline functions
11. C++ programs are normally typed into a computer using a(n) ________ program.
scope
/n
prompt
editor
12. The sign you use for pointers
static
/n
beginning
*
13. For every opening brace in a C++ program there must be a ______________.
syntax
Closing brace
unary scope resolution operator (::)
#include <headerfilename>
14. The ________ program transfers the executable image of a C++ program from disk to memory.
whitespace
loader
return
a.out
15. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
constant variable
cin >> variable
function scope
static
16. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
function scope
getline
left
cout
17. Names of things that are used in a program - can apply to variables & constants and functions
this
function overloading
identifiers
searching
18. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
integer operands
dot (.)
//
beginning
19. Creates a copy of a string.
data type
return
arithmetic expression
strcpy()
20. __________ can be used to assign an object of a class to another object of the same class.
prompt
attributes
if...else
Default memberwise assignment
21. The number used to refer to a particular element of an array is called its ________.
subscript (or index)
selection
initialized
strlen()
22. Type casting syntax
associations
static_cast<char>(65)
if
function parameters
23. A filestream variable that represents the default input source
new line
cin
named constant
stack
24. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
switch
void pointer
register
25. Header file that contains commonly performed mathematical functions
const datatype identifier = value
unary operator
Unified Modeling Language(UML)
cmath
26. 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.
type coercion
/n
preprocessor
rand
27. Lists and tables of values can be stored in arrays or __________.
globals
unary scope resolution operator (::)
vectors
register
28. In inheritance the ____________ is the class the receives the inherited members.
semantics
getline
derived class
NULL
29. Use 2 characters to represent one
semantics
escape sequences
default constructor
access specifier
30. A __________ data member represents class-wide information.
preprocessor
initialized
overloading
static
31. Executable version of program
linker
if
object file
Arithmetic Operators
32. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
function scope
type coercion
return
function prototype
33. Identifier or expression that is part of the calculation to be performed
semicolon
mixed expression
operand value
left
34. To allow file access in a program you must #include this header file.
//
fstream
operator overloading
definition
35. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
two-dimensional
//
global
36. directive A statement that starts with a # is called a ____________.
type casting (conversion)
Preprocessor
unary operator
comments
37. Returns the length of a string excluding the null terminator.
like-type expression
strlen()
object-oriented analysis and design (OOAD)
void
38. A function that can be used to read character data including whitespace
cin.get(ch)
if
globals
new line
39. The modulus operator (%) can be used only with __________.
integer operands
function call
fixed
srand
40. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
dot (.)
main
assignment
41. Default name of executable file
NULL
a.out
reserved words
void
42. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
sorting
Sentinel
fstream
43. A member function should be declared static if it does not access __________ class members.
non-static
classes
unary operator
strcmp()
44. newline
static
n
strcmp()
function scope
45. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
if
*
named constant
attributes
46. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
loader
operator overloading
function prototype
classes
47. Most calculations are normally performed by ______ statements.
assignment
register
{ }
delete
48. Program components in C++ are called functions and ________.
recursive
object file
classes
identifiers
49. 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
endl (same as 'n')
subscript (or index)
Unified Modeling Language(UML)
50. The only integer that can be assigned directly to a pointer is_____________.
cmath
Closing brace
0
associations