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. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
Closing brace
strcpy()
named constant
if...else
2. Two slash marks ( // ) indicate __________ of a comment
preprocessor
beginning
cin.get(ch)
classes
3. This is used to mark the end of a complete C++ programming statement.
default constructor
Semicolon
register
if
4. The idea that you can call the same function and the output will depend on the type of object you're using.
polymorphism
NULL
default constructor
floating-point
5. Used to qualify hidden names so that they can be used.
escape sequences
classes
scope resolution operator
Counter-controlled or definite
6. Sets floating-point values to a fixed decimal format
fstream
fixed
searching
ofstream
7. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
reserve words
char
template
function scope
8. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')
char
unary operator
//
getline
9. A __________ data member represents class-wide information.
searching
cin
static
endl (same as 'n')
10. To write data to a file you define an object of which one of the following
?
new line
ofstream
function parameters
11. The stream insertion operator
static
preprocessor
strlen()
<<
12. Class members specified as _________ are accessible anywhere an object of the class is in scope.
Sentinel
floating-point
public
rand
13. = & | are examples of ____________.
special symbols
variable
const
base class
14. To allow file access in a program you must #include this header file.
selection
return
fstream
globals
15. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.
if...else
new line
void pointer
Closing brace
16. This manipulator is used to establish a field width for the value immediately following it.
register
globals
setw
address
17. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
type casting (conversion)
getline
strcpy()
sorting
18. The __________ operator reclaims memory previously allocated by new.
integer operands
delete
sorting
int values
19. A member function should be declared static if it does not access __________ class members.
definition
non-static
setw
address
20. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
overloading
register
scope resolution operator
const
21. 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.
srand
strcpy()
/n
delete
22. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
pointer
binary operator
object file
23. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
fixed
*
return
assignment statement
24. A constant object must be __________; it cannot be modified after it is created.
initialized
{ }
default constructor
like-type expression
25. directive A statement that starts with a # is called a ____________.
Preprocessor
overloading
recursive function
token
26. A type of pointer that can point at objects of any data type.
recursive function
overloading
member
void pointer
27. Whole numbers - no decimals and no commas included
function prototype
void pointer
int values
prompt
28. Naming convention for C++ programs
.cpp
Sentinel
endl (same as 'n')
static_cast<char>(65)
29. 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
unary scope resolution operator (::)
#include
data type
30. Compares two strings and returns 0 if they are equal.
template
*
/n
strcmp()
31. You must have a ___________ for every variable you intend to use in a program
preprocessor
definition
static
allocating memory
32. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
function prototype
beginning
type coercion
inheritance
33. A memory location with a name and data type - its content may be changed during program execution
type casting (conversion)
variable
prompt
base class
34. Most calculations are normally performed by ______ statements.
switch
assignment
prompt
associations
35. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
dot (.)
continue
type coercion
Stack overflow
36. Repeating a set of instructions a specific number of times is called_________repetition.
function parameters
Counter-controlled or definite
derived class
base
37. 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.
return
strcpy()
member
static
38. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
pointer
classes
overloading
NULL
39. If a member initializer is not provided for a member object of a class the object's __________ is called.
searching
virtual functions
cin.get(ch)
default constructor
40. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
loader
classes
#include
ofstream
41. In inheritance the ____________ is the class that supplies the inherited members.
named constant
base class
inheritance
inline functions
42. Program components in C++ are called functions and ________.
classes
loader
strcmp()
preprocessor
43. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
const datatype identifier = value
token
continue
named constant
44. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
type casting (conversion)
cin
break
globals
45. A __________ should be used to declare the size of an array because it makes the program more scalable.
vectors
constant variable
classes
Unified Modeling Language(UML)
46. Operator with only one operand
/n
unary operator
% modulus
a.out
47. Grammar rules of the language; compiler will try to identify and locate syntax errors
variables
cout
editor
syntax
48. An operator that can only be used with int values. result will always be an int.
public
% modulus
endl (same as 'n')
semicolon
49. 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
beginning
reserve words
operator
50. The sign you use for references
&
public
pointer
semicolon