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.
base
{ }
getline
variables
2. Member objects are constructed __________ their enclosing class object.
classes
prompt
before
escape sequences
3. Used to qualify hidden names so that they can be used.
scope resolution operator
&
fixed
heap
4. This is used to mark the end of a complete C++ programming statement.
0
Stack overflow
Semicolon
strlen()
5. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.
pointer
Stack overflow
strcmp()
linker
6. An expression in which all operands have the same data type - result will have the same data type as operands
arithmetic expression
like-type expression
opened
function prototype
7. Use 2 characters to represent one
break
initialized
escape sequences
n
8. Syntax for named constant declaration
type casting (conversion)
% modulus
Preprocessor
const datatype identifier = value
9. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
//
reserve words
unary operator
data type
10. Keyword public is a(n) _________
variables
access specifier
attributes
virtual functions
11. You must have a ___________ for every variable you intend to use in a program
special symbols
function parameters
.cpp
definition
12. Forces the computer to display decimal point and trailing zeroes
showpoint
type
inline functions
integer operands
13. To write data to a file you define an object of which one of the following
ofstream
syntax
object file
?
14. C++ programs are normally typed into a computer using a(n) ________ program.
main
void
Closing brace
editor
15. A filestream variable that represents the default output device
cout
&
non-static
loader
16. __________ can be used to assign an object of a class to another object of the same class.
attributes
escape sequences
semantics
Default memberwise assignment
17. Operator with only one operand
unary operator
base
floating-point
strcpy()
18. data types that refer to numbers with decimals
floating-point
0
const
switch
19. A member function should be declared static if it does not access __________ class members.
ofstream
function parameters
non-static
allocating memory
20. The symbol for the binary scope resolution operator
dot (.)
semicolon
::
derived class
21. Function ________ is used to produce random numbers.
Default memberwise assignment
rand
type casting (conversion)
vectors
22. 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.
endl (same as 'n')
void
member
Arithmetic Operators
23. Every C++ statement ends with a(n) _________.
named constant
opened
semicolon
identifiers
24. Smallest individual unit of a programming language - special symbols or word symbols or identifiers
beginning
% modulus
assignment statement
token
25. The ________ program transfers the executable image of a C++ program from disk to memory.
Arithmetic Operators
loader
operand value
function scope
26. A C++ statement that makes a decision is ______.
pointer
if
cin
function call
27. A type of pointer that can point at objects of any data type.
% modulus
void pointer
object-oriented analysis and design (OOAD)
case sensitive
28. In inheritance the ____________ is the class that supplies the inherited members.
base class
semantics
escape sequences
return
29. Returns the length of a string excluding the null terminator.
semicolon
Literals
strlen()
void pointer
30. These are data items whose values do not change while the program is running
Literals
if
operator
cmath
31. The modulus operator (%) can be used only with __________.
left
register
integer operands
operator overloading
32. If a member initializer is not provided for a member object of a class the object's __________ is called.
recursive function
default constructor
global
fixed
33. Compares two strings and returns 0 if they are equal.
t
strcmp()
named constant
void
34. A ________ program executes before the compiler's translation phase begins.
Counter-controlled or definite
auto
preprocessor
showpoint
35. The ________ of an identifier is the portion of the program in which the identifier can be used.
cmath
scope
Default memberwise assignment
syntax
36. A variable that holds the address of another variable.
pointer
a.out
overloading
Preprocessor
37. A memory location with a name and data type - its content may be changed during program execution
heap
variable
endl (same as 'n')
operator overloading
38. Names of things that are used in a program - can apply to variables & constants and functions
function parameters
comments
identifiers
prompt
39. A filestream variable that represents the default input source
/n
&
cin
definition
40. A __________ data member represents class-wide information.
attributes
continue
static
reserved words
41. Sets floating-point values to a fixed decimal format
pointer
strlen()
fixed
operand value
42. Program components in C++ are called functions and ________.
static
cin.get(ch)
return
classes
43. The idea that you can call the same function and the output will depend on the type of object you're using.
object file
polymorphism
semantics
void pointer
44. You can declare default values for a function in the ____________________.
function parameters
type coercion
main
0
45. The stream extraction operator
const
>>
sorting
{ }
46. Used for function calls and local variables
linker
named constant
stack
access specifier
47. Type casting syntax
data type
cin.get(ch)
template
static_cast<char>(65)
48. Characters used to separate symbols or reserved words or identifiers and statements
&
//
whitespace
scope resolution operator
49. Most calculations are normally performed by ______ statements.
token
Preprocessor
assignment
address
50. A________ allows the compiler to check the number & types and order of the arguments passed to a function.
delete
opened
function prototype
loader