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. Two slash marks ( // ) indicate __________ of a comment
address
beginning
definition
Sentinel
2. In inheritance the ____________ is the class that supplies the inherited members.
scope resolution operator
local variable
getline
base class
3. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
case sensitive
heap
token
friend
4. Every C++ statement ends with a(n) _________.
special symbols
semicolon
two-dimensional
const datatype identifier = value
5. A member function should be declared static if it does not access __________ class members.
assignment
showpoint
like-type expression
non-static
6. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
variables
#include
default constructor
template
7. Lists and tables of values can be stored in arrays or __________.
classes
vectors
public
return
8. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
private
sorting
dot (.)
comments
9. A set of values together with a set of operations
data type
void
private
a.out
10. Type casting syntax
operand value
static_cast<char>(65)
pointer
base class
11. Returns the length of a string excluding the null terminator.
template
constant variable
strlen()
base
12. Keyword public is a(n) _________
const datatype identifier = value
access specifier
initialized
Preprocessor
13. 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.
cin.get(ch)
continue
Sentinel
data type
14. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
private
unary operator
::
15. An expression in which all operands have the same data type - result will have the same data type as operands
cin
like-type expression
Closing brace
before
16. The process of analyzing and designing a system from an object-oriented point of view is called ________.
Arithmetic Operators
srand
recursive function
object-oriented analysis and design (OOAD)
17. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
allocating memory
?
#include <headerfilename>
cin >> variable
18. To write data to a file you define an object of which one of the following
void
ofstream
attributes
binary operator
19. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
function overloading
cin >> variable
Literals
n
20. You must have a ___________ for every variable you intend to use in a program
definition
integer operands
arithmetic expression
whitespace
21. A C++ statement that makes a decision is ______.
operator
//
if
searching
22. A constant object must be __________; it cannot be modified after it is created.
initialized
operator
Preprocessor
function scope
23. Use 2 characters to represent one
static_cast<char>(65)
auto
escape sequences
{ }
24. int namespace include using return examples of ___________
associations
reserve words
fstream
0
25. Characters used to separate symbols or reserved words or identifiers and statements
t
whitespace
access specifier
friend
26. The symbol for the binary scope resolution operator
cin >> variable
::
function prototype
like-type expression
27. Forces the computer to display decimal point and trailing zeroes
two-dimensional
type casting (conversion)
showpoint
fixed
28. The ________ qualifier is used to declare read-only variables.
loader
base class
const
integer operands
29. The idea that you can call the same function and the output will depend on the type of object you're using.
if...else
register
polymorphism
integer operands
30. 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.
Preprocessor
scope resolution operator
initialized
information hiding
31. A program that finds and attaches to your program the indicated libraries for compilation
like-type expression
default constructor
local variable
preprocessor
32. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
cout
binary operator
#include
globals
33. A ________ program executes before the compiler's translation phase begins.
#include
preprocessor
binary operator
/n
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.
break
cin
int values
#include directive
35. directive A statement that starts with a # is called a ____________.
Preprocessor
operator
NULL
recursive function
36. A variable that holds the address of another variable.
fstream
operator
pointer
/n
37. Every C++ program begins execution at the function _________.
0
base class
main
operator
38. Sets floating-point values to a fixed decimal format
like-type expression
unary scope resolution operator (::)
fixed
sorting
39. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
address
>>
function prototype
searching
40. Preprocessor directive syntax
strcpy()
continue
#include <headerfilename>
data type
41. Most calculations are normally performed by ______ statements.
sorting
register
setw
assignment
42. All C++ Variables are_________.
Semicolon
case sensitive
assignment statement
preprocessor
43. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
selection
semantics
a.out
44. For every opening brace in a C++ program there must be a ______________.
non-static
Closing brace
Arithmetic Operators
variables
45. The sign you use for references
break
strcpy()
char
&
46. Naming convention for C++ programs
Stack overflow
object-oriented analysis and design (OOAD)
this
.cpp
47. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
static
named constant
selection
#include
48. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
Arithmetic Operators
overloading
recursive
Sentinel
49. Function ________ is used to set the random number seed to randomize a program.
operand value
srand
int values
loader
50. The __________ operator reclaims memory previously allocated by new.
delete
dot (.)
allocating memory
getline