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 program that finds and attaches to your program the indicated libraries for compilation
const
prompt
preprocessor
if
2. Whole numbers - no decimals and no commas included
Closing brace
int values
base
whitespace
3. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
Default memberwise assignment
void
% modulus
4. 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.
Counter-controlled or definite
inheritance
.cpp
case sensitive
5. int namespace include using return examples of ___________
reserve words
base
setw
register
6. A sequence of operands and operators that describe a calculation to be performed
arithmetic expression
if
#include <headerfilename>
binary operator
7. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
variables
pointer
cin.get(ch)
n
8. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
register
endl (same as 'n')
srand
reserved words
9. Two slash marks ( // ) indicate __________ of a comment
named constant
attributes
beginning
constant variable
10. A __________ should be used to declare the size of an array because it makes the program more scalable.
base class
constant variable
reserved words
derived class
11. A function that can be used to read character data including whitespace
cin.get(ch)
if
Arithmetic Operators
rand
12. Use 2 characters to represent one
subscript (or index)
escape sequences
before
void
13. 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.
scope
?
inline functions
selection
14. Nonexecutable statements that are included in a program to provide information about what the program does etc.
comments
.cpp
function prototype
a.out
15. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
a.out
overloading
object-oriented analysis and design (OOAD)
dot (.)
16. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
assignment
::
default constructor
17. To write data to a file you define an object of which one of the following
ofstream
non-static
member
before
18. Manipulator that causes the insertion point (cursor) to move to the beginning of the next line
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. Keyword public is a(n) _________
access specifier
fixed
//
semicolon
20. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
virtual functions
const
.cpp
return
21. 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
delete
inheritance
register
22. Type casting syntax
return
endl (same as 'n')
Semicolon
static_cast<char>(65)
23. All C++ Variables are_________.
like-type expression
register
case sensitive
function scope
24. 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.
continue
cin >> variable
/n
semicolon
25. Used to qualify hidden names so that they can be used.
register
<<
scope resolution operator
vectors
26. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
address
rand
break
void
27. Forces the computer to display decimal point and trailing zeroes
stack
preprocessor
variables
showpoint
28. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
unary operator
operand value
globals
29. The sign you use for pointers
arithmetic expression
function overloading
classes
*
30. The process of determining if an array contains a particular key value is called _________ the array.
base
searching
int values
heap
31. This manipulator is used to establish a field width for the value immediately following it.
case sensitive
setw
non-static
#include <headerfilename>
32. 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.
strcpy()
non-static
auto
Sentinel
33. A member function should be declared static if it does not access __________ class members.
type
if
non-static
prompt
34. newline
semantics
ofstream
n
function call
35. * / % + -
break
searching
preprocessor
Arithmetic Operators
36. Classes can have relationships with other classes. These relationships are called ________.
associations
if
constant variable
this
37. Returns the length of a string excluding the null terminator.
friend
private
% modulus
strlen()
38. The stream insertion operator
allocating memory
type coercion
initialized
<<
39. Identifier or expression that is part of the calculation to be performed
assignment
continue
operand value
break
40. Used for dynamically allocated variables
heap
beginning
% modulus
polymorphism
41. Every C++ program begins execution at the function _________.
heap
main
attributes
Unified Modeling Language(UML)
42. Associate an identifier with a memory location
const
allocating memory
overloading
preprocessor
43. Message displayed to the screen asking user for input; generated with an output statement
associations
function prototype
prompt
delete
44. A __________ data member represents class-wide information.
const
.cpp
static
return
45. To allow file access in a program you must #include this header file.
subscript (or index)
default constructor
fstream
editor
46. Sets floating-point values to a fixed decimal format
default constructor
fixed
floating-point
cout
47. data types that refer to numbers with decimals
?
floating-point
local variable
mixed expression
48. A filestream variable that represents the default output device
editor
cout
unary scope resolution operator (::)
integer operands
49. A variable that is known only within the function in which it is defined is called a ________.
void
local variable
Counter-controlled or definite
editor
50. Repeating a set of instructions a specific number of times is called_________repetition.
variables
operand value
delete
Counter-controlled or definite