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. A variable that holds the address of another variable.
identifiers
syntax
pointer
Stack overflow
2. A function ________ enables a single function to be defined to perform a task on many different data types.
getline
unary operator
variable
template
3. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.
variable
template
recursive
selection
4. A function that calls itself
access specifier
strlen()
special symbols
recursive function
5. Sets floating-point values to a fixed decimal format
pointer
fixed
base
cmath
6. Lists and tables of values can be stored in arrays or __________.
default constructor
break
vectors
type coercion
7. = & | are examples of ____________.
private
special symbols
auto
friend
8. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
escape sequences
register
token
arithmetic expression
9. This manipulator is used to establish a field width for the value immediately following it.
beginning
non-static
delete
setw
10. Function ________ is used to produce random numbers.
escape sequences
static_cast<char>(65)
rand
Closing brace
11. An operator that can only be used with int values. result will always be an int.
prompt
% modulus
strcpy()
switch
12. Default name of executable file
variables
function parameters
Preprocessor
a.out
13. 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.
static
unary operator
friend
.cpp
14. A filestream variable that represents the default input source
virtual functions
unary scope resolution operator (::)
base
cin
15. Symbol that denotes an action to be performed
stack
editor
public
operator
16. A file must be ________ before data can be written to or read from it.
opened
a.out
const
&
17. Used for dynamically allocated variables
n
identifiers
heap
object-oriented analysis and design (OOAD)
18. The elements of an array are related by the fact that they have the same name and ___________.
NULL
type
whitespace
static
19. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
arithmetic expression
globals
subscript (or index)
a.out
20. You must have a ___________ for every variable you intend to use in a program
definition
delete
left
template
21. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
selection
type coercion
semantics
constant variable
22. 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
const datatype identifier = value
main
n
23. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
register
friend
register
auto
24. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
derived class
recursive
switch
new line
25. The sign you use for references
default constructor
&
function overloading
const
26. The sign you use for pointers
source file
a.out
*
default constructor
27. Header file that contains commonly performed mathematical functions
<<
cmath
non-static
register
28. When a value of one data type is implicitly (automatically) changed to another data type
constant variable
type coercion
int values
dot (.)
29. Used for function calls and local variables
stack
fixed
base class
void
30. Returns the length of a string excluding the null terminator.
strlen()
operator
ofstream
#include directive
31. The storage-class specifiers are mutable - auto - ________ - extern and static.
/n
register
inline functions
return
32. The _____ causes the contents of another file to be inserted into a program.
return
#include directive
?
subscript (or index)
33. Naming convention for C++ programs
const
?
.cpp
rand
34. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
Literals
private
default constructor
switch
35. Whole numbers - no decimals and no commas included
/n
operator overloading
int values
floating-point
36. A variable that is known only within the function in which it is defined is called a ________.
void
static_cast<char>(65)
local variable
operator overloading
37. A variable declared outside any block or function is a ________ variable.
function scope
0
global
classes
38. __________ can be used to assign an object of a class to another object of the same class.
linker
Default memberwise assignment
% modulus
srand
39. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
char
classes
reserved words
base class
40. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
//
linker
pointer
void
41. Message displayed to the screen asking user for input; generated with an output statement
prompt
polymorphism
left
editor
42. 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.
allocating memory
?
cin.get(ch)
cin
43. The process of placing the elements of an array in order is called ________ the array.
NULL
delete
sorting
function prototype
44. Used to qualify hidden names so that they can be used.
showpoint
scope resolution operator
semicolon
function prototype
45. Syntax for named constant declaration
const datatype identifier = value
address
classes
endl (same as 'n')
46. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
cin
sorting
vectors
47. Operator with two operands
binary operator
public
type
operator
48. A function is invoked with a ________.
function call
semicolon
binary operator
>>
49. Compares two strings and returns 0 if they are equal.
strcmp()
public
stack
int values
50. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
Closing brace
auto
unary operator
derived class