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 a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.
fixed
comments
static
Stack overflow
2. Creates a copy of a string.
local variable
strcpy()
endl (same as 'n')
classes
3. A filestream variable that represents the default input source
classes
cin
Default memberwise assignment
Closing brace
4. Symbol that denotes an action to be performed
ofstream
operator
#include
srand
5. An operator that can only be used with int values. result will always be an int.
static
% modulus
char
#include
6. Every C++ program begins execution at the function _________.
&
identifiers
polymorphism
main
7. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
classes
assignment
editor
Default memberwise assignment
8. A file must be ________ before data can be written to or read from it.
void
opened
*
n
9. The process of analyzing and designing a system from an object-oriented point of view is called ________.
rand
object-oriented analysis and design (OOAD)
static
void
10. 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.
auto
/n
public
fstream
11. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
showpoint
object file
prompt
private
12. A __________ should be used to declare the size of an array because it makes the program more scalable.
constant variable
scope resolution operator
unary scope resolution operator (::)
searching
13. If a member initializer is not provided for a member object of a class the object's __________ is called.
strcmp()
friend
opened
default constructor
14. A human readable file that contains C++ program
left
//
source file
scope resolution operator
15. A sequence of operands and operators that describe a calculation to be performed
cin.get(ch)
int values
0
arithmetic expression
16. Member objects are constructed __________ their enclosing class object.
#include directive
before
beginning
scope resolution operator
17. A set of values together with a set of operations
vectors
n
data type
associations
18. The _________ begins the body of every function and the _________ ends the body of every function.
global
{ }
variables
object-oriented analysis and design (OOAD)
19. A variable that is known only within the function in which it is defined is called a ________.
preprocessor
unary scope resolution operator (::)
local variable
initialized
20. Allows the programmer to store a value in a variable
scope
type coercion
attributes
assignment statement
21. Used for dynamically allocated variables
function parameters
derived class
heap
fstream
22. Lists and tables of values can be stored in arrays or __________.
return
vectors
classes
escape sequences
23. Used for function calls and local variables
comments
operator
stack
default constructor
24. These are data items whose values do not change while the program is running
Literals
classes
Unified Modeling Language(UML)
virtual functions
25. C++ programs are normally typed into a computer using a(n) ________ program.
setw
srand
base
editor
26. This is used to mark the end of a complete C++ programming statement.
Semicolon
subscript (or index)
Arithmetic Operators
operator
27. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
showpoint
inheritance
beginning
auto
28. A type of pointer that can point at objects of any data type.
source file
*
void pointer
integer operands
29. The number used to refer to a particular element of an array is called its ________.
default constructor
fixed
{ }
subscript (or index)
30. Preprocessor directive syntax
syntax
static_cast<char>(65)
#include <headerfilename>
int values
31. A function that can be used to read character data including whitespace
showpoint
cin.get(ch)
?
address
32. 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.
variables
base class
opened
?
33. All ______ must be declared before they are used.
variables
two-dimensional
allocating memory
reserve words
34. Executable version of program
dot (.)
linker
object file
::
35. Classes can have relationships with other classes. These relationships are called ________.
associations
public
this
stack
36. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
integer operands
whitespace
base class
37. The only integer that can be assigned directly to a pointer is_____________.
delete
0
Default memberwise assignment
preprocessor
38. The modulus operator (%) can be used only with __________.
mixed expression
integer operands
scope
prompt
39. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
loader
this
Preprocessor
endl (same as 'n')
40. The stream extraction operator
associations
>>
fstream
<<
41. An expression that has operands with different data types
pointer
&
mixed expression
linker
42. A ________ program executes before the compiler's translation phase begins.
preprocessor
Stack overflow
a.out
data type
43. 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.
void
::
variables
break
44. A C++ statement that makes a decision is ______.
new line
base class
token
if
45. Use 2 characters to represent one
whitespace
Literals
escape sequences
type
46. You must have a ___________ for every variable you intend to use in a program
scope resolution operator
cout
definition
template
47. Message displayed to the screen asking user for input; generated with an output statement
prompt
definition
cin
void pointer
48. Whole numbers - no decimals and no commas included
int values
::
member
mixed expression
49. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
syntax
stack
token
object file
50. 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
fstream
Default memberwise assignment
mixed expression