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. For every opening brace in a C++ program there must be a ______________.
#include <headerfilename>
semantics
Sentinel
Closing brace
2. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
auto
Arithmetic Operators
function prototype
allocating memory
3. To write data to a file you define an object of which one of the following
inheritance
variable
initialized
ofstream
4. The elements of an array are related by the fact that they have the same name and ___________.
strlen()
operator overloading
type
semantics
5. Returns the length of a string excluding the null terminator.
loader
fixed
constant variable
strlen()
6. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
pointer
opened
public
private
7. All ______ must be declared before they are used.
token
information hiding
variables
0
8. The stream extraction operator
before
>>
data type
constant variable
9. This is used to mark the end of a complete C++ programming statement.
public
overloading
recursive
Semicolon
10. A function that calls itself
recursive function
int values
new line
prompt
11. Forces the computer to display decimal point and trailing zeroes
static
showpoint
data type
cin >> variable
12. A ________ program executes before the compiler's translation phase begins.
loader
public
preprocessor
int values
13. Use 2 characters to represent one
heap
escape sequences
classes
information hiding
14. The modulus operator (%) can be used only with __________.
fixed
special symbols
reserve words
integer operands
15. Initializers __________ must be used to initialize constant members of a class.
classes
Preprocessor
member
static
16. Grammar rules of the language; compiler will try to identify and locate syntax errors
break
syntax
int values
classes
17. The ________ qualifier is used to declare read-only variables.
getline
left
const
function call
18. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
opened
Unified Modeling Language(UML)
cin >> variable
getline
19. Two slash marks ( // ) indicate __________ of a comment
beginning
assignment
named constant
sorting
20. 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.
dot (.)
void pointer
searching
operator overloading
21. Identifier or expression that is part of the calculation to be performed
reserve words
virtual functions
member
operand value
22. Naming convention for C++ programs
ofstream
//
subscript (or index)
.cpp
23. The process of placing the elements of an array in order is called ________ the array.
token
sorting
scope resolution operator
public
24. Classes can have relationships with other classes. These relationships are called ________.
named constant
<<
operator overloading
associations
25. Function ________ is used to set the random number seed to randomize a program.
::
srand
scope resolution operator
linker
26. To explicitly indicate that a value is to be converted to another type
void pointer
binary operator
semicolon
type casting (conversion)
27. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
//
like-type expression
.cpp
mixed expression
28. The ________ enables access to a global variable with the same name as a variable in the current scope.
unary scope resolution operator (::)
operator
continue
prompt
29. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
#include directive
function parameters
operator overloading
assignment
30. 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.
derived class
getline
?
unary operator
31. The sign you use for pointers
*
unary operator
address
strcmp()
32. You must have a ___________ for every variable you intend to use in a program
selection
recursive
definition
srand
33. A memory location with a name and data type - its content may be changed during program execution
*
base
variable
&
34. Compares two strings and returns 0 if they are equal.
strcmp()
type
semantics
type casting (conversion)
35. C++ programs are normally typed into a computer using a(n) ________ program.
void pointer
editor
cout
type
36. Message displayed to the screen asking user for input; generated with an output statement
prompt
derived class
::
#include directive
37. Symbol that denotes an action to be performed
operator
strlen()
polymorphism
reserve words
38. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
binary operator
.cpp
continue
getline
39. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
integer operands
base
register
local variable
40. An array that uses two subscripts is referred to as a(n) _________ array.
two-dimensional
return
rand
semicolon
41. The three ways to return control from a called function to a caller are ________ - return expression and encounter.
stack
&
before
return
42. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call
function scope
const
base
loader
43. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
like-type expression
friend
recursive
#include
44. A human readable file that contains C++ program
{ }
#include <headerfilename>
source file
arithmetic expression
45. Type casting syntax
static
static_cast<char>(65)
function parameters
pointer
46. A function is invoked with a ________.
Closing brace
constant variable
return
function call
47. The _____ causes the contents of another file to be inserted into a program.
#include directive
recursive function
two-dimensional
.cpp
48. Program components in C++ are called functions and ________.
classes
int values
showpoint
overloading
49. directive A statement that starts with a # is called a ____________.
Preprocessor
operator
Sentinel
function prototype
50. A function that can be used to read character data including whitespace
cin.get(ch)
pointer
Literals
n