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. Allows the programmer to store a value in a variable
editor
like-type expression
assignment statement
&
2. Every C++ program begins execution at the function _________.
main
Literals
left
switch
3. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
void pointer
break
editor
ofstream
4. The address-of operator. it is used to assign pointers and to print the address of variables.
derived class
private
&
function call
5. The three values that can be used to initialize a pointer are 0 - __________ and an address.
void
NULL
allocating memory
ofstream
6. An expression in which all operands have the same data type - result will have the same data type as operands
information hiding
recursive function
like-type expression
classes
7. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
const datatype identifier = value
member
Semicolon
8. This is used to mark the end of a complete C++ programming statement.
operand value
Semicolon
Stack overflow
type
9. Program components in C++ are called functions and ________.
classes
cmath
//
setw
10. Forces the computer to display decimal point and trailing zeroes
derived class
type
showpoint
char
11. A type of pointer that can point at objects of any data type.
Stack overflow
void pointer
syntax
dot (.)
12. 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.
rand
case sensitive
data type
void
13. Repeating a set of instructions a specific number of times is called_________repetition.
/n
comments
unary scope resolution operator (::)
Counter-controlled or definite
14. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
cin >> variable
initialized
strlen()
this
15. Type casting syntax
pointer
static_cast<char>(65)
allocating memory
return
16. Naming convention for C++ programs
#include
semantics
virtual functions
.cpp
17. Preprocessor directive syntax
#include <headerfilename>
scope
showpoint
non-static
18. Two slash marks ( // ) indicate __________ of a comment
Semicolon
reserved words
beginning
inheritance
19. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
void
cmath
special symbols
Preprocessor
20. A file must be ________ before data can be written to or read from it.
base
.cpp
opened
prompt
21. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
0
named constant
{ }
comments
22. The _____ causes the contents of another file to be inserted into a program.
arithmetic expression
#include directive
Counter-controlled or definite
access specifier
23. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
auto
base class
n
24. A variable that is known only within the function in which it is defined is called a ________.
rand
strlen()
unary operator
local variable
25. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.
attributes
#include
continue
inheritance
26. An array that uses two subscripts is referred to as a(n) _________ array.
binary operator
two-dimensional
cin.get(ch)
cout
27. If a member initializer is not provided for a member object of a class the object's __________ is called.
default constructor
cin
searching
non-static
28. Classes can have relationships with other classes. These relationships are called ________.
special symbols
void pointer
beginning
associations
29. Member objects are constructed __________ their enclosing class object.
//
before
Preprocessor
type
30. Every C++ statement ends with a(n) _________.
recursive
char
classes
semicolon
31. 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.
source file
NULL
allocating memory
dot (.)
32. The size & shape & color and weight of an object are considered
cin >> variable
globals
getline
attributes
33. 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
prompt
new line
Default memberwise assignment
34. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
linker
overloading
switch
showpoint
35. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
virtual functions
classes
template
associations
36. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.
derived class
register
function overloading
Preprocessor
37. = & | are examples of ____________.
special symbols
template
register
function prototype
38. A __________ data member represents class-wide information.
data type
int values
static
mixed expression
39. 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
&
Closing brace
base
/n
40. For every opening brace in a C++ program there must be a ______________.
n
a.out
heap
Closing brace
41. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
cin
access specifier
selection
information hiding
42. Grammar rules of the language; compiler will try to identify and locate syntax errors
syntax
cout
definition
Counter-controlled or definite
43. 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
>>
new line
return
44. The modulus operator (%) can be used only with __________.
integer operands
preprocessor
a.out
/n
45. A ________ program executes before the compiler's translation phase begins.
preprocessor
getline
globals
like-type expression
46. C++ programs are normally typed into a computer using a(n) ________ program.
% modulus
Counter-controlled or definite
editor
left
47. A set of values together with a set of operations
data type
inline functions
source file
stack
48. A __________ should be used to declare the size of an array because it makes the program more scalable.
function parameters
register
recursive function
constant variable
49. The process of placing the elements of an array in order is called ________ the array.
Stack overflow
Sentinel
sorting
preprocessor
50. The ________ statement in a called function passes the value of an expression back to the calling function.
strlen()
arithmetic expression
showpoint
return