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. Most calculations are normally performed by ______ statements.
assignment
void pointer
Default memberwise assignment
dot (.)
2. Syntax for named constant declaration
Closing brace
const datatype identifier = value
friend
% modulus
3. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.
//
case sensitive
token
break
4. C++ programs are normally typed into a computer using a(n) ________ program.
{ }
operator
editor
beginning
5. All C++ Variables are_________.
case sensitive
return
Preprocessor
&
6. These are data items whose values do not change while the program is running
editor
variable
<<
Literals
7. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.
local variable
register
new line
before
8. Sets floating-point values to a fixed decimal format
{ }
linker
cout
fixed
9. A human readable file that contains C++ program
const
source file
classes
heap
10. Keyword public is a(n) _________
access specifier
friend
Unified Modeling Language(UML)
attributes
11. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.
getline
definition
function scope
initialized
12. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.
friend
a.out
private
associations
13. An expression that has operands with different data types
Closing brace
//
mixed expression
char
14. The sign you use for references
n
&
recursive
?
15. Compares two strings and returns 0 if they are equal.
strcmp()
integer operands
two-dimensional
classes
16. The size & shape & color and weight of an object are considered
function call
return
getline
attributes
17. For every opening brace in a C++ program there must be a ______________.
0
friend
Closing brace
named constant
18. A pointer is a variable that contains as its value the____________ of another variable.
Stack overflow
scope
static
address
19. A sequence of operands and operators that describe a calculation to be performed
type coercion
arithmetic expression
//
&
20. Class members specified as _________ are accessible anywhere an object of the class is in scope.
switch
editor
public
operator overloading
21. An expression in which all operands have the same data type - result will have the same data type as operands
like-type expression
strlen()
reserved words
% modulus
22. A filestream variable that represents the default input source
setw
stack
0
cin
23. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.
switch
default constructor
fixed
inline functions
24. You can declare default values for a function in the ____________________.
this
source file
Preprocessor
function parameters
25. Allows the programmer to store a value in a variable
<<
Preprocessor
assignment statement
Default memberwise assignment
26. Used for function calls and local variables
register
fixed
const
stack
27. Whole numbers - no decimals and no commas included
member
int values
opened
definition
28. * / % + -
whitespace
selection
classes
Arithmetic Operators
29. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.
template
//
Literals
polymorphism
30. A __________ data member represents class-wide information.
Counter-controlled or definite
source file
arithmetic expression
static
31. The _________ begins the body of every function and the _________ ends the body of every function.
srand
selection
{ }
mixed expression
32. A program that finds and attaches to your program the indicated libraries for compilation
identifiers
special symbols
allocating memory
preprocessor
33. Characters used to separate symbols or reserved words or identifiers and statements
void
whitespace
global
recursive
34. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.
if...else
Closing brace
identifiers
endl (same as 'n')
35. Names of things that are used in a program - can apply to variables & constants and functions
information hiding
Preprocessor
identifiers
const datatype identifier = value
36. Repeating a set of instructions a specific number of times is called_________repetition.
globals
virtual functions
register
Counter-controlled or definite
37. A variable declared outside any block or function is a ________ variable.
pointer
global
fstream
% modulus
38. A member function should be declared static if it does not access __________ class members.
0
Preprocessor
syntax
non-static
39. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors
semantics
&
vectors
stack
40. All ______ must be declared before they are used.
member
binary operator
variables
setw
41. An array that uses two subscripts is referred to as a(n) _________ array.
type coercion
two-dimensional
type
dot (.)
42. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time
cin >> variable
this
reserved words
token
43. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.
searching
return
continue
rand
44. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.
srand
.cpp
int values
void
45. The ________ enables access to a global variable with the same name as a variable in the current scope.
token
base
unary scope resolution operator (::)
unary operator
46. The number used to refer to a particular element of an array is called its ________.
register
subscript (or index)
virtual functions
getline
47. A function is invoked with a ________.
function call
<<
allocating memory
overloading
48. The _____ causes the contents of another file to be inserted into a program.
#include directive
if...else
% modulus
function prototype
49. This is used to mark the end of a complete C++ programming statement.
endl (same as 'n')
two-dimensional
Semicolon
public
50. Program components in C++ are called functions and ________.
classes
template
static
pointer