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. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
constant variable
register
Sentinel
>>
2. A __________ should be used to declare the size of an array because it makes the program more scalable.
::
constant variable
#include directive
type
3. The ________ enables access to a global variable with the same name as a variable in the current scope.
char
unary scope resolution operator (::)
void pointer
% modulus
4. To allow file access in a program you must #include this header file.
stack
overloading
variables
fstream
5. 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
6. 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.
searching
?
static_cast<char>(65)
return
7. The idea that you can call the same function and the output will depend on the type of object you're using.
void
function prototype
polymorphism
floating-point
8. Header file that contains commonly performed mathematical functions
strlen()
classes
cmath
sorting
9. A function that calls itself
Literals
{ }
recursive function
scope
10. Whole numbers - no decimals and no commas included
int values
classes
data type
allocating memory
11. To explicitly indicate that a value is to be converted to another type
function parameters
cin.get(ch)
#include <headerfilename>
type casting (conversion)
12. A file must be ________ before data can be written to or read from it.
before
opened
virtual functions
identifiers
13. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
two-dimensional
#include <headerfilename>
void
address
14. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
assignment
named constant
searching
scope resolution operator
15. A __________ data member represents class-wide information.
static
recursive function
whitespace
associations
16. The symbol for the binary scope resolution operator
static
::
#include
ofstream
17. A variable that is known only within the function in which it is defined is called a ________.
semantics
operand value
local variable
const datatype identifier = value
18. The _____ causes the contents of another file to be inserted into a program.
register
#include directive
a.out
scope resolution operator
19. Keyword public is a(n) _________
const datatype identifier = value
access specifier
public
classes
20. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .
function scope
allocating memory
static_cast<char>(65)
register
21. A variable declared outside any block or function is a ________ variable.
global
void
preprocessor
token
22. Creates a copy of a string.
new line
floating-point
strcpy()
variable
23. Preprocessor directive syntax
editor
>>
#include <headerfilename>
selection
24. A set of values together with a set of operations
preprocessor
char
data type
friend
25. An operator that can only be used with int values. result will always be an int.
srand
inline functions
% modulus
private
26. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.
#include
overloading
public
delete
27. The only integer that can be assigned directly to a pointer is_____________.
two-dimensional
type coercion
unary scope resolution operator (::)
0
28. You can declare default values for a function in the ____________________.
comments
token
function parameters
two-dimensional
29. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
attributes
function prototype
unary scope resolution operator (::)
default constructor
30. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
classes
const
Counter-controlled or definite
binary operator
31. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.
strcmp()
#include
binary operator
this
32. int namespace include using return examples of ___________
object-oriented analysis and design (OOAD)
reserve words
/n
register
33. The _________ begins the body of every function and the _________ ends the body of every function.
allocating memory
Unified Modeling Language(UML)
{ }
srand
34. 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.
associations
cout
Sentinel
rand
35. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.
unary scope resolution operator (::)
0
overloading
% modulus
36. This manipulator is used to establish a field width for the value immediately following it.
base class
stack
setw
heap
37. All C++ Variables are_________.
return
case sensitive
selection
srand
38. Nonexecutable statements that are included in a program to provide information about what the program does etc.
data type
opened
Counter-controlled or definite
comments
39. Characters used to separate symbols or reserved words or identifiers and statements
data type
dot (.)
whitespace
searching
40. An array that uses two subscripts is referred to as a(n) _________ array.
token
two-dimensional
?
return
41. * / % + -
Preprocessor
object-oriented analysis and design (OOAD)
showpoint
Arithmetic Operators
42. To write data to a file you define an object of which one of the following
ofstream
integer operands
*
function scope
43. __________ can be used to assign an object of a class to another object of the same class.
token
Default memberwise assignment
% modulus
like-type expression
44. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
function prototype
static
beginning
pointer
45. Class members specified as _________ are accessible anywhere an object of the class is in scope.
pointer
public
const datatype identifier = value
mixed expression
46. Most calculations are normally performed by ______ statements.
assignment
function call
operator
type coercion
47. Type casting syntax
reserve words
strlen()
static_cast<char>(65)
function call
48. A member function should be declared static if it does not access __________ class members.
return
if
non-static
case sensitive
49. A pointer is a variable that contains as its value the____________ of another variable.
case sensitive
showpoint
cout
address
50. Default name of executable file
syntax
floating-point
a.out
case sensitive