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. For every opening brace in a C++ program there must be a ______________.
type casting (conversion)
mixed expression
Closing brace
unary operator
2. This manipulator causes the field to be left-justified with padding spaces printed to the right.
ofstream
classes
left
function scope
3. * / % + -
special symbols
function prototype
cin
Arithmetic Operators
4. Characters used to separate symbols or reserved words or identifiers and statements
Unified Modeling Language(UML)
whitespace
static_cast<char>(65)
special symbols
5. When a value of one data type is implicitly (automatically) changed to another data type
Unified Modeling Language(UML)
type coercion
scope
assignment statement
6. 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.
public
void
if...else
member
7. 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
fstream
Literals
cin.get(ch)
base
8. Type casting syntax
global
static_cast<char>(65)
&
non-static
9. The idea that you can call the same function and the output will depend on the type of object you're using.
//
polymorphism
static
inline functions
10. The stream insertion operator
*
<<
rand
scope
11. A function that can be used to read character data including whitespace
fstream
cin.get(ch)
void
base
12. The sign you use for pointers
*
syntax
operator
fixed
13. Initializers __________ must be used to initialize constant members of a class.
{ }
member
heap
prompt
14. 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.
static
information hiding
t
linker
15. 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
auto
reserved words
template
16. 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.
object file
function prototype
two-dimensional
Sentinel
17. Function ________ is used to set the random number seed to randomize a program.
type coercion
rand
srand
two-dimensional
18. Associate an identifier with a memory location
void pointer
function call
Arithmetic Operators
allocating memory
19. A set of values together with a set of operations
data type
linker
base class
operator overloading
20. Use 2 characters to represent one
stack
escape sequences
function overloading
showpoint
21. Keyword public is a(n) _________
return
before
information hiding
access specifier
22. 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.
inheritance
recursive
cout
dot (.)
23. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
strcmp()
?
{ }
cin >> variable
24. A member function should be declared static if it does not access __________ class members.
subscript (or index)
% modulus
non-static
.cpp
25. A file must be ________ before data can be written to or read from it.
scope
opened
a.out
recursive function
26. You can declare default values for a function in the ____________________.
if
NULL
function parameters
escape sequences
27. directive A statement that starts with a # is called a ____________.
Preprocessor
globals
strlen()
cin.get(ch)
28. Symbol that denotes an action to be performed
source file
allocating memory
operator
const
29. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
special symbols
::
//
30. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
Default memberwise assignment
switch
Unified Modeling Language(UML)
data type
31. Executable version of program
{ }
syntax
object file
vectors
32. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.
delete
access specifier
inline functions
Closing brace
33. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
auto
n
recursive
Default memberwise assignment
34. A constant object must be __________; it cannot be modified after it is created.
assignment
initialized
searching
recursive function
35. Lists and tables of values can be stored in arrays or __________.
vectors
::
identifiers
showpoint
36. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
public
Stack overflow
type
selection
37. data types that refer to numbers with decimals
setw
a.out
Literals
floating-point
38. The size & shape & color and weight of an object are considered
register
integer operands
function prototype
attributes
39. The process of determining if an array contains a particular key value is called _________ the array.
searching
cin
loader
const datatype identifier = value
40. Compares two strings and returns 0 if they are equal.
strcmp()
switch
>>
floating-point
41. A filestream variable that represents the default output device
preprocessor
scope resolution operator
cout
showpoint
42. A function is invoked with a ________.
Semicolon
linker
function call
local variable
43. A __________ data member represents class-wide information.
function scope
function call
function prototype
static
44. All ______ must be declared before they are used.
static
variables
case sensitive
#include <headerfilename>
45. Most calculations are normally performed by ______ statements.
Preprocessor
friend
address
assignment
46. Program components in C++ are called functions and ________.
left
&
classes
scope resolution operator
47. A variable that is known only within the function in which it is defined is called a ________.
getline
return
local variable
inline functions
48. Classes can have relationships with other classes. These relationships are called ________.
mixed expression
source file
associations
classes
49. The _________ begins the body of every function and the _________ ends the body of every function.
scope
{ }
reserve words
srand
50. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
before
global
classes
char