C++ Flashcards
The job of the _______ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information
CPU
computers can do many different jobs because they can be ?
Programmed
Internally, the CPU consists of the _______ and the ______
Arithmetic Logic Unit and Control Unit
A _______ is an example of a secondary storage
Disk
The two general categories of software are ______ and _____
System Software and Application Software
A program is a set of _________
instructions
Since computers can’t be programmed in natural language, algorithms must be writer in a ____________ language
Programmable language
________ us the only language computers really process
machine language
_______________ languages are close to the level of humans in terms of readability
high level
____________ languages are close to the level of the computer
low level
A program’s ability to run on several different types of computers is called ______________
Portability
Words that have special meaning in a programming language are called
key words
Words of names defined by the programmer are called _________
programmer defined symbols
____________ are characters or symbols that perform operations on one or more operands
operators
___________ characters or symbols mark the beginning or ending of programming statements, or separate items in a list.
punctuation
the rules that must be followed when constructing a program are called
syntax
_______ is a named storage location
variable
A variable must be ________ before it can be used in a program
defined
the three primary activities of a program are _______, _______, and ______.
input, processing, output
_______ is the information a program gathers from the outside world
input
_____ is information a program sends to the outside world
output
A ______ is a diagram that graphically illustrates the structure of a program
hierarchy chart
Every complete statement ends with a ______
semicolon
which of the following statements is correct?
include
Every C++ program must have a function _____
main
Preprocessor directives begin with a _____.
#
A group of statements, such as the contents of a function, is enclosed in ______ .
Braces { }
Which of the following statements are not valid in cout statements?
all couts need cout <;
The negation operator is ____
Unary
An _____ is like a variable, but its value is read only and cannot be changed during the programs execution
named Constant
When to processor directives execute?
Before the compiler compiles your program
A variable must be defined before it can be used?
True
Variable names may begin with a number?
False
Variable names may be up to 31 characters long?
True
A left brace in a C++ program should always be followed by a right brace later in the program
True
You cannot initialize a named constant that is declared with the const modifier
False
An expression using the greater than, less than, greater than or equal to, less than or equal to, equal, or not equal to operator is called a _____ expression
relational
A relational expression is either ______ or ________.
true or false
The if statement regards an expression with the value 0 as ______
False
The if statement regard an expression with a nonzero value as ______.
True
For an if statement to conditionally execute a group of statements, the statement must be enclosed in a set of _________.
Braces
In an if/else statement, the if past executes its statement or block if the expression is _______, and else part executes its statement or block if the expression is ________.
true, false
The trailing else is an if/else statement that has a similar purposed as the _______ section of a switch statement
default
The if / else statement is actually a form of the _____ statement
nested
If the sub-expression on the left of the _____ logical operator is false. The right sub-expression is not checked.
&& And
If the sub-expression on the left of an ______ logical operator is true, the right sub-expression is not checked.
|| Or
The ______ logical operator has higher precedence than the other logical operators.
! Net
The logical operators have _______ associativity
left to right
The ________ logical operator works best when testing a number to determine if it is within a range
&& And
The _______ logical operator works best when testing a number to determine if it is outside a range.
|| Or
A variable with ______ scope is only visible when the program is executing in the block containing the variables definition
block
You use the ________ operator to determine whether one string object is greater then another string object.
> Greater
An expression using the ________ operator is called an conditional expression
conditional
The expression that is tested by a switch statement must have an _____ value
interger
The expression following a case statement must be an _____.
integer constant
A program will “Fall through” a case section if it is missing the _____ statement
Break
The = operator and the == operator perform the same expression when used in a Boolean expression?
False
A variable defined in an inner block may not have the same name as a variable defined in the outer block?
false
A conditionally executed statement should be indented one level from the if statement?
True
All lines in a block should be indented one level?
True
It’s safe to assume that all uninitialized variable automatically start with 0 as their value?
False
When an if statement is nested in the part if part of another statement, the only time the inner if is executed is when the expression of the outer if is true?
True
When an if statement is nested in the else part of another statement, as in an if else if, the only time the inner if is executed is when the expression of the other if is true?
False
The scope of a variable is limited to the block in which it is defined
True
You can use relational operators to compare string objects
True
x ! = y is the same as (x>y || x<y) ?
True
y= y ?
False
x>=y is the same as (x>y && x=y) ?
False
To ______ a value means to increase it by one and to _____ a value means to decrease it by one?
increment, decrement
When the increment or decrement operator is place before the operand ( or to the operands left) the operator is being used in the ____mode?
prefix
When the increment or decrement operator is placed after the operand ( or to the operands right), the operand is being used in the ______ mode.
postfix
The statement of clock that is repeated is known as the _______ of the loop
body
Each repetition of a loop is known as a ________.
iteration
A loop that evaluates its test expression before each repetition is an ____ loop
pretest
A loop that evaluates its test expression after each repetition is an ______ loop
posttest
A loop that does not have a way of stopping is called an ________ loop
infinite or endless
A __________ is a variable that counts the number of times a loop repeats
counter
A ______ is a sum of numbers that accumulated with each iteration of a loop
running total
A _________ is a variable that is initialized to some starting value, usually zero, and then has numbers added to it in each iteration of a loop
accumulator