C++ Midterm
which of the following is NOT a string literal constant?
'abc'
an example of an instruction written in machine language would be ______.
0000 0101 1100 0000
what is the result of raising the base number to the 0th power?
1
how many different states do the switches in machine language have?
2
in the following pseudocode algorithm, what is the output given the following inputs? 1. enter the sale price and sales tax rate 2. calculate the cost by multiplying the sale price by the sales tax rate and then adding the result to the sale price. 3. display the cost
2.12
what is the ASCII value for the "0" character?
48
what is the decimal equivalent of the binary number 110?
6
what is the name of a coding scheme that assigns a specific numeric code to each character on your keyboard?
ASCII
which of the following is a language typically used to create procedure-oriented programs?
COBOL
what type of chart helps programmers organize and summarize the results of the analysis step?
IPO
what do some programmers use to organize and summarize the results of a problem analysis?
IPO chart
which of the following is an example of an instruction written in assembly language?
MUL, bx, ax
which of the following would be example of invalid data?
a negative tax rate
which of the following would be a valid name for a memory location in C++?
a1B2c3D4
which of the following is a set of step-by-step instructions that accomplish a task?
algorithm
what is the first step in the problem-solving process?
analyze the problem
what do programs written in assembly language require to convert the assembly language instructions into machine language?
assembler
what are program instructions that utilize mnemonics called?
assembly code
which number system is used to store data in memory?
binary
to be sure an algorithm works correctly, you should desk-check it several times using which of the following?
both valid and invalid data
when a variable's name contains two or more words, most C++ programmers enter the name using what type of notation?
camel case
which of the following translates all of a program's high-level instructions before running the program?
compiler
when declaring a named constant, which keyword indicates that the memory location being declared cannot be changed during runtime?
const
what is the name for the basic structure that controls the overall flow of a program's logic?
control
in which column of the desk-checking table do you enter the expected output of the following algorithm? 1. enter the sale price and sales tax rate 2. calculate the sales tax by multiplying the sale price by the sales tax rate 3. calculate the cost by adding the sales tax to the sale price 4. display the cost desk-check table: sales price sales tax rate sales tax cost`
cost
the choice of whether to turn left or right at a fork in the road is an example of which type of structure?
decision
when a value is converted from one data type to another data type that can store smaller numbers,what type of conversion has occurred?
demotion
which step comes after you plan the algorithm in the problem-solving process?
desk-check the algorithm
which of the following pseudocode statements represents output?
display the miles per gallon
all numeric literal constants with a decimal place are considered which data type?
double
most algorithms begin with instructions to do which of the following?
enter input items
a computer translates instructions line by line as the program is running.
false
an interpreter translates all of a program's high-level instructions into machine language before executing the program.
false
assembly language requires a programmer to enter the program using 1s and 0s
false
camel case means capitalizing the entire name of a variable or named constant.
false
mnemonics are a special number system used by assembly languages.
false
pseudocode uses standardized symbols to visually depict an algorithm.
false
the first step in the problem-solving process is to desk-check the program?
false
the main reason for desk-checking an algorithm is to check for spelling errors.
false
the name of memory location in C++ can begin with a letter or a number.
false
the repetition structure has a true path and a false path.
false
the selection structure is also referred to as in iteration.
false
the value 29 is considered a double
false
the value of a named constant is allowed to change during runtime.
false
there is one universal machine language used by computers?
false
when naming a memory location in C++, names are not case sensitive.
false
when using flowcharts, the input/output symbol is represented by an oval.
false
you need to consider all information when analyzing a problem, even if it is unnecessary to the solution.
false
you need to use both pseudocode and a flowchart when planning an algorithm.
false
which of the following data types can contain a real number?
float
which of the following uses standardized symbols to visually depict an algorithm?
flowchart
what is used to connect the different symbols in a flowchart?
flowlines
what is another name for desk-checking?
hand-tracing
C++, Visual Basic, Java, and C# are examples of what type of language that can be used to create both procedure-oriented and object-oriented programs?
high-level
if the value's data type does not match the memory location's data type, what process does the computer use to convert the value to fit the memory location?
implicit type conversion
what is the term used for the assignment a beginning value to a memory location?
initializing
review the following pseudocode. what type of item is sales tax rate? 1. enter the sale price and sales tax rate. 2. calculate the cost by multiplying the sale price by the sales tax rate and then adding the result to the sale price. 3. display the cost
input
what does the parallelogram symbol in a flowchart represent?
input/output
what type of value does a processing item represent when processing the input into the output?
intermediate
which of the following translates program instructions line by line as the program is running?
interpreter
which of the following is a word that has a special meaning in the programming language you are using?
keyword
what is an item of data that can appear in a program instruction and can be stored in a memory location.
literal constant
what is another name for a repetition structure?
loop structure
what are program instructions written in 1s and 0s called?
machine code
which of the following is NOT a rule for naming a memory location in C++?
names in C++ are not case sensitive
with what type of program does the programmer focus on structures that represent screen elements such as check boxes and buttons or structures that represent real world items such as an employee or time card?
object-oriented
memory location assigned the char data type can store how many characters?
one
which of the following best represents the goal of the problem-solving process?
output
what is the second step in the problem-solving process?
plan the algorithm
the algorithm is recorded in which section of the IPO chart?
processing
what does the rectangle symbol in a flowchart represent?
processing
C++, Visual Basic, C#, Python, and Java are all examples of what kind of language?
programming
what programming language allows programmers to jot down their ideas using a human-readable language without having to worry about the syntax of the programming language itself?
pseudocode
which statement is an example of a repetition structure?
repeat (2 times)
what type of structure is the following set of statements an example of? while not end of file read a line end while
repetition
in the following pseudocode algorithm, which of the following is considered a processing item? 1. enter the sale price and sales tax rate. 2. calculate the sales tax by multiplying the sale price by the sales tax rate. 3. calculate the cost by adding the sales tax to the sale price. 4. display the cost
sales tax
which structure do you use every time you drive your car and approach an intersection?
selection
which type of structure is the following set of statements an example of? if time-of-day is greater than noon set afternoon access permissions else set regular access permissions end if
selection
which type of structure makes a decision based on one or more conditions?
selection
in a computer program, which type of logic structure directs the computer to process the program instructions one after another, in the order listed in the program?
sequence
which type of structure do all programs use?
sequence
what character is used to enclose a character literal constant?
single quotes
which of the following best describes a computer program that is implemented with a computer?
solution
what does the oval symbol in a flowchart represent?
start/stop
which data type is referred to as a user-defined data type?
string
an accountant that is part of a programming team working on a program that requires accounting experience is an example of which of the following?
subject matter expert
in the following pseudocode, which item is considered a processing item? 1. enter the midterm score and final score 2. calculate the sum by adding together the midterm score and final score 3. calculate the average score by dividing the sum by 2 4. display the average score
sum
after coding a program, the programmer should perform which task before releasing it to the user?
test the program with sample data
a processing item in an IPO chart represents an intermediate value that the algorithm uses when processing the input into the output.
true
a variable is a memory location whose value can change during runtime.
true
in C++, the float and double variable data types are used to store real numbers.
true
in object-oriented programming, an object can be used in more than one program; often with little to no modification
true
pseudocode is not standardized, each programmer has his/her own version.
true
the main reason why high-level languages were a vast improvement over machine and assembly languages is because they allow the programmer to use instructions that more closely resemble the English language.
true
there are two digits in the machine language system.
true
to ensure the algorithm is working correctly, a programmer should desk-check it using both valid and invalid data.
true
the short data type can store a number in the range from -32,768 to +32,768. how many bytes of memory is required for the short data type?
two
with whom should a programmer have extensive interaction before converting a solution to a problem into a computer program?
user
in a pseudocode algorithm, what part of language should each instruction begin with?
verb