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 modulus operator (%) can be used only with __________.
auto
left
information hiding
integer operands
2. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
if...else
default constructor
/n
static
3. Two slash marks ( // ) indicate __________ of a comment
default constructor
reserved words
/n
beginning
4. A variable that is known only within the function in which it is defined is called a ________.
overloading
int values
recursive
local variable
5. Naming convention for C++ programs
subscript (or index)
.cpp
reserved words
this
6. The ________ statement in a called function passes the value of an expression back to the calling function.
showpoint
return
definition
inheritance
7. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.
virtual functions
Arithmetic Operators
auto
#include directive
8. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
n
auto
fstream
source file
9. directive A statement that starts with a # is called a ____________.
integer operands
0
showpoint
Preprocessor
10. The process of placing the elements of an array in order is called ________ the array.
linker
address
sorting
private
11. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.
?
recursive
pointer
access specifier
12. 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.
constant variable
base class
Sentinel
cin >> variable
13. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
selection
reserved words
main
polymorphism
14. The symbol for the binary scope resolution operator
type
whitespace
::
Arithmetic Operators
15. 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
operator overloading
Arithmetic Operators
base
base class
16. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
global
Arithmetic Operators
function call
17. The ________ program combines the output of the compiler with various library functions to produce an executable image.
{ }
ofstream
arithmetic expression
linker
18. All ______ must be declared before they are used.
variables
sorting
assignment statement
heap
19. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
identifiers
sorting
classes
object file
20. A variable declared outside any block or function is a ________ variable.
global
two-dimensional
new line
like-type expression
21. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.
Counter-controlled or definite
token
classes
const
22. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
variables
% modulus
case sensitive
23. Forces the computer to display decimal point and trailing zeroes
showpoint
if
globals
this
24. Initializers __________ must be used to initialize constant members of a class.
reserved words
associations
recursive
member
25. 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.
?
constant variable
void
Arithmetic Operators
26. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
function call
a.out
cin >> variable
{ }
27. When a value of one data type is implicitly (automatically) changed to another data type
type coercion
% modulus
derived class
void
28. To write data to a file you define an object of which one of the following
ofstream
prompt
unary operator
a.out
29. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
#include
>>
pointer
30. Use 2 characters to represent one
% modulus
unary operator
escape sequences
cin
31. Every C++ statement ends with a(n) _________.
const
switch
semicolon
register
32. These are data items whose values do not change while the program is running
escape sequences
vectors
Literals
linker
33. data types that refer to numbers with decimals
definition
floating-point
stack
cin
34. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
srand
setw
delete
break
35. Returns the length of a string excluding the null terminator.
Semicolon
Stack overflow
strlen()
unary scope resolution operator (::)
36. The ________ qualifier is used to declare read-only variables.
operator
constant variable
linker
const
37. 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
38. Function ________ is used to produce random numbers.
function call
semantics
>>
rand
39. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.
case sensitive
static
prompt
#include <headerfilename>
40. A memory location with a name and data type - its content may be changed during program execution
before
variable
0
Literals
41. Whole numbers - no decimals and no commas included
Closing brace
break
int values
inheritance
42. 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.
this
a.out
Stack overflow
information hiding
43. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
token
like-type expression
//
#include directive
44. The _____ causes the contents of another file to be inserted into a program.
two-dimensional
access specifier
subscript (or index)
#include directive
45. The __________ operator reclaims memory previously allocated by new.
virtual functions
delete
function scope
int values
46. You must have a ___________ for every variable you intend to use in a program
associations
cin
showpoint
definition
47. A function that can be used to read character data including whitespace
//
cin.get(ch)
/n
editor
48. For every opening brace in a C++ program there must be a ______________.
Closing brace
editor
identifiers
static_cast<char>(65)
49. A filestream variable that represents the default input source
object-oriented analysis and design (OOAD)
recursive function
cin
two-dimensional
50. Words that are used for special purposes in a program
left
pointer
subscript (or index)
reserved words