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. Every C++ statement ends with a(n) _________.
editor
#include directive
semicolon
loader
2. Compares two strings and returns 0 if they are equal.
floating-point
fixed
strcmp()
% modulus
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.
main
variables
syntax
break
4. Used for function calls and local variables
globals
stack
loader
&
5. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.
floating-point
&
Literals
globals
6. Characters used to separate symbols or reserved words or identifiers and statements
whitespace
type coercion
sorting
Stack overflow
7. This manipulator is used to establish a field width for the value immediately following it.
member
break
setw
type coercion
8. Two slash marks ( // ) indicate __________ of a comment
beginning
Semicolon
NULL
variables
9. Operator with two operands
binary operator
register
strlen()
#include
10. A type of pointer that can point at objects of any data type.
binary operator
void pointer
recursive function
const
11. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
beginning
void
delete
12. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
Unified Modeling Language(UML)
type
int values
token
13. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
srand
//
special symbols
integer operands
14. The modulus operator (%) can be used only with __________.
local variable
integer operands
friend
strcpy()
15. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
token
semicolon
whitespace
delete
16. An expression that has operands with different data types
mixed expression
strlen()
ofstream
Literals
17. * / % + -
function parameters
inline functions
Arithmetic Operators
virtual functions
18. Grammar rules of the language; compiler will try to identify and locate syntax errors
void
#include directive
function overloading
syntax
19. Allows the programmer to store a value in a variable
type coercion
arithmetic expression
dot (.)
assignment statement
20. 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.
base class
virtual functions
classes
Sentinel
21. Syntax for named constant declaration
void
comments
fstream
const datatype identifier = value
22. The ________ statement in a called function passes the value of an expression back to the calling function.
return
register
recursive
strcpy()
23. Used to qualify hidden names so that they can be used.
function prototype
public
variables
scope resolution operator
24. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
inline functions
new line
strcmp()
25. Associate an identifier with a memory location
getline
allocating memory
member
like-type expression
26. Default name of executable file
two-dimensional
escape sequences
a.out
operator overloading
27. 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.
n
rand
/n
classes
28. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
token
before
cmath
named constant
29. 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.
auto
char
static
.cpp
30. To explicitly indicate that a value is to be converted to another type
fixed
template
type casting (conversion)
globals
31. A C++ statement that makes a decision is ______.
function overloading
function scope
static_cast<char>(65)
if
32. This is used to mark the end of a complete C++ programming statement.
Semicolon
rand
reserve words
base
33. The ________ program combines the output of the compiler with various library functions to produce an executable image.
void pointer
template
data type
linker
34. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
Default memberwise assignment
char
cout
heap
35. Lists and tables of values can be stored in arrays or __________.
Literals
case sensitive
cin
vectors
36. The only integer that can be assigned directly to a pointer is_____________.
operator
0
named constant
unary scope resolution operator (::)
37. Sets floating-point values to a fixed decimal format
before
globals
two-dimensional
fixed
38. The sign you use for references
template
unary scope resolution operator (::)
static
&
39. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.
inheritance
auto
comments
member
40. A human readable file that contains C++ program
preprocessor
assignment statement
source file
function scope
41. Function ________ is used to set the random number seed to randomize a program.
>>
srand
vectors
classes
42. When a value of one data type is implicitly (automatically) changed to another data type
getline
information hiding
type coercion
.cpp
43. A function that calls itself either directly or indirectly - through another function) - is a ________ function.
if
//
token
recursive
44. A function is invoked with a ________.
?
function call
Arithmetic Operators
&
45. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
Default memberwise assignment
editor
0
return
46. __________ can be used to assign an object of a class to another object of the same class.
Default memberwise assignment
identifiers
cout
endl (same as 'n')
47. A __________ data member represents class-wide information.
allocating memory
definition
static
/n
48. Program components in C++ are called functions and ________.
pointer
if
classes
assignment
49. 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.
definition
#include
dot (.)
assignment statement
50. int namespace include using return examples of ___________
reserve words
strcmp()
semantics
like-type expression