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. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
data type
vectors
Stack overflow
selection
2. 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.
setw
>>
Sentinel
const datatype identifier = value
3. 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.
Literals
global
editor
?
4. If a member initializer is not provided for a member object of a class the object's __________ is called.
default constructor
object-oriented analysis and design (OOAD)
public
definition
5. In inheritance the ____________ is the class the receives the inherited members.
derived class
showpoint
% modulus
::
6. All C++ Variables are_________.
>>
case sensitive
attributes
comments
7. Creates a copy of a string.
strcpy()
scope
reserved words
two-dimensional
8. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
source file
&
getline
semicolon
9. Sets floating-point values to a fixed decimal format
{ }
fixed
polymorphism
editor
10. An operator that can only be used with int values. result will always be an int.
special symbols
% modulus
main
#include
11. The ________ of an identifier is the portion of the program in which the identifier can be used.
scope
Unified Modeling Language(UML)
cmath
cin
12. Function ________ is used to set the random number seed to randomize a program.
srand
assignment
member
showpoint
13. A variable declared outside any block or function is a ________ variable.
heap
global
switch
globals
14. Operator with two operands
binary operator
overloading
escape sequences
strlen()
15. Returns the length of a string excluding the null terminator.
token
/n
pointer
strlen()
16. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
overloading
register
continue
delete
17. data types that refer to numbers with decimals
variable
floating-point
int values
information hiding
18. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
type casting (conversion)
scope resolution operator
overloading
register
19. The process of placing the elements of an array in order is called ________ the array.
recursive
vectors
sorting
srand
20. Function ________ is used to produce random numbers.
if
rand
opened
loader
21. Symbol that denotes an action to be performed
rand
operator
unary scope resolution operator (::)
special symbols
22. The _________ begins the body of every function and the _________ ends the body of every function.
{ }
cmath
ofstream
static
23. A variable that holds the address of another variable.
pointer
stack
const
object file
24. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
rand
function overloading
.cpp
globals
25. A ________ program executes before the compiler's translation phase begins.
Default memberwise assignment
pointer
preprocessor
strcpy()
26. Whole numbers - no decimals and no commas included
sorting
static_cast<char>(65)
scope
int values
27. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
Default memberwise assignment
type casting (conversion)
#include <headerfilename>
28. For every opening brace in a C++ program there must be a ______________.
subscript (or index)
Closing brace
friend
new line
29. Words that are used for special purposes in a program
Sentinel
return
reserved words
char
30. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
operator
globals
base
function scope
31. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
semantics
auto
function prototype
preprocessor
32. Executable version of program
#include
sorting
register
object file
33. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
named constant
scope resolution operator
n
scope
34. To write data to a file you define an object of which one of the following
ofstream
showpoint
&
Stack overflow
35. You must have a ___________ for every variable you intend to use in a program
subscript (or index)
pointer
definition
static
36. Used for function calls and local variables
stack
register
before
return
37. A pointer is a variable that contains as its value the____________ of another variable.
semantics
function scope
cin.get(ch)
address
38. Two slash marks ( // ) indicate __________ of a comment
associations
beginning
constant variable
variables
39. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
auto
fstream
private
escape sequences
40. The ________ statement in a called function passes the value of an expression back to the calling function.
address
integer operands
cin >> variable
return
41. Default name of executable file
Literals
unary operator
static_cast<char>(65)
a.out
42. A file must be ________ before data can be written to or read from it.
//
opened
operator
case sensitive
43. Nonexecutable statements that are included in a program to provide information about what the program does etc.
ofstream
comments
*
inheritance
44. newline
n
object-oriented analysis and design (OOAD)
escape sequences
global
45. Type casting syntax
{ }
if
constant variable
static_cast<char>(65)
46. A type of pointer that can point at objects of any data type.
derived class
source file
globals
void pointer
47. 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.
void
Stack overflow
inheritance
case sensitive
48. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
//
return
editor
inheritance
49. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
private
semicolon
cin >> variable
polymorphism
50. A __________ should be used to declare the size of an array because it makes the program more scalable.
Closing brace
prompt
n
constant variable