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. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
recursive function
if
NULL
getline
2. Class members specified as _________ are accessible only to member functions of the class and friends of the class.
main
overloading
classes
private
3. 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.
?
main
srand
Counter-controlled or definite
4. Whole numbers - no decimals and no commas included
int values
//
attributes
Literals
5. The _____ causes the contents of another file to be inserted into a program.
Closing brace
rand
unary scope resolution operator (::)
#include directive
6. To allow file access in a program you must #include this header file.
fstream
selection
switch
srand
7. 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
8. The _________ begins the body of every function and the _________ ends the body of every function.
semantics
mixed expression
{ }
escape sequences
9. Class members specified as _________ are accessible anywhere an object of the class is in scope.
auto
register
delete
public
10. The process of determining if an array contains a particular key value is called _________ the array.
searching
static_cast<char>(65)
variables
fstream
11. An expression that has operands with different data types
if
mixed expression
globals
member
12. Function ________ is used to set the random number seed to randomize a program.
editor
auto
scope
srand
13. The address-of operator. it is used to assign pointers and to print the address of variables.
&
base
attributes
cin.get(ch)
14. Symbol that denotes an action to be performed
heap
operator
new line
continue
15. The stream extraction operator
>>
constant variable
getline
stack
16. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.
pointer
classes
polymorphism
preprocessor
17. A variable declared outside any block or function is a ________ variable.
if...else
whitespace
global
base class
18. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.
function scope
Unified Modeling Language(UML)
switch
int values
19. The process of analyzing and designing a system from an object-oriented point of view is called ________.
object-oriented analysis and design (OOAD)
Arithmetic Operators
::
base class
20. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
variable
Stack overflow
globals
void pointer
21. Returns the length of a string excluding the null terminator.
private
strlen()
initialized
subscript (or index)
22. Function ________ is used to produce random numbers.
rand
main
delete
template
23. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
scope resolution operator
void
assignment
escape sequences
24. Names of things that are used in a program - can apply to variables & constants and functions
semicolon
cin
Closing brace
identifiers
25. The ________ program transfers the executable image of a C++ program from disk to memory.
global
assignment
access specifier
loader
26. Program components in C++ are called functions and ________.
char
return
classes
floating-point
27. C++ programs are normally typed into a computer using a(n) ________ program.
cout
object file
editor
if
28. A member function should be declared static if it does not access __________ class members.
non-static
Stack overflow
function overloading
data type
29. A pointer is a variable that contains as its value the____________ of another variable.
?
type casting (conversion)
virtual functions
address
30. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________
variable
operator overloading
overloading
scope
31. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
Semicolon
function prototype
auto
named constant
32. __________ can be used to assign an object of a class to another object of the same class.
cin.get(ch)
recursive function
Default memberwise assignment
left
33. All ______ must be declared before they are used.
variables
object file
inheritance
integer operands
34. Keyword public is a(n) _________
selection
access specifier
function overloading
strcmp()
35. These are data items whose values do not change while the program is running
comments
Literals
preprocessor
if...else
36. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
if
const
globals
semantics
37. The idea that you can call the same function and the output will depend on the type of object you're using.
Preprocessor
polymorphism
main
prompt
38. For every opening brace in a C++ program there must be a ______________.
Closing brace
dot (.)
local variable
break
39. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution
token
cmath
named constant
member
40. data types that refer to numbers with decimals
>>
mixed expression
t
floating-point
41. Executable version of program
<<
operator
object file
rand
42. Initializers __________ must be used to initialize constant members of a class.
static
source file
member
token
43. You can declare default values for a function in the ____________________.
this
function parameters
initialized
&
44. Compares two strings and returns 0 if they are equal.
static_cast<char>(65)
mixed expression
strcmp()
special symbols
45. A memory location with a name and data type - its content may be changed during program execution
function parameters
Preprocessor
variable
a.out
46. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
void pointer
strlen()
register
recursive function
47. A __________ data member represents class-wide information.
static
static_cast<char>(65)
new line
Arithmetic Operators
48. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.
vectors
data type
classes
.cpp
49. int namespace include using return examples of ___________
const datatype identifier = value
0
reserve words
Closing brace
50. Used for function calls and local variables
::
//
stack
srand