Final Exam CS21 UVM
The while loop is a _______ type of loop a) pretest b) no-test c) prequalified d) post-iterative
a) pretest
The symbols > < and == are all _____________ operators a) relational b) logical c) conditional d) ternary
a) relational
A _______ is any hypothetical person using a program and providing input for it. a) designer b) user c) guinea pig d) test subject
b) user
This is an operator that raises a number to a power a) % b) * c) ** d) /
c) **
A bit that is turned off represents the following value: _______________ a) 1 b) -1 c) 0 d) "no"
c) 0
An extensive encoding scheme that can represent the characters of many of the language in the world is ______________ a) binary numbering b) ASCII c) Unicode d) ENIAC
c) Unicode
A _________ structure can execute a set of statements only under certain circumstances a) sequence b) circumstantial c) decision d) boolean
c) decision
(T/F) A condition-controlled loop always repeats a specific number of times
False
(T/F) A program can be made of only one type of control structure. you cannot combine structures
False
(T/F) A syntax error does not prevent a program from being compiled and executed
False
(T/F) Assembly language is considered a high-level language
False
(T/F) If you print a variable that has not been assigned a value, the number 0 will be displayed
False
(T/F) Images, like the ones you make with your digital camera, cannot be stored as binary numbers
False
(T/F) Programmers must be careful not to make syntax errors when writing pseudocode programs
False
(T/F) The process of input validation works as follows: when the user of a program enters invalid data, the program should ask the user "Are you sure you meant to enter that?" If the user answers "yes", the program should accept the data
False
(T/F) To calculate the total number of iterations of a nested loop, add the number of iterations to all of the loops
False
(T/F) Today, CPUs are huge devices made of electrical and mechanical components such as vacuum tubes and switches.
False
(T/F) Windows Vista, Linux, UNIX, and MAC OS X are all examples of application software
False
(T/F) Word processing programs, spreadsheet programs, email programs, web browsers, and games are all examples of utility programs
False
(T/F) variable names can have spaces in them
False
(T/F) you can write a program using only sequence structures
False
(T/f) A single alternative decision structure tests a condition and then takes one path if the condition is true, or another if the condition is false.
False
(T/F) Main memory is also known as RAM
True
(T/F) The following statements subtracts 1 from x: x = x-1
True
(T/F) the while loop is a pretest loop
True
(T/F) Machine language is the only language that a CPU understands
True
(T/F) A compound Boolean expression created with the AND operator is true only when both subexpressions are true.
True
(T/F) A decision structure can be nested inside another structure
True
(T/F) An interpreter is a program that both translates and executes the instructions in a high-level language program
True
(T/F) Any piece of data that is stored in a computer's memory must be stored as a binary number
True
(T/F) In a math expression, multiplication and division take place before addition and subtraction
True
(T/F) In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop
True
(T/F) In most languages, the first character of a variable name cannot be a number
True
This operator performs division, but instead of returning the quotient it returns the remainder a) % b) * c) ** d) /
a) %
This operator performs integer division a) // b) % c) ** d) /
a) //
A bit that is turned on represents the following value: _______________ a) 1 b) -1 c) 0 d) "no"
a) 1
This is volatile type of memory that used only for temporary storage while a program is running a) RAM b) secondary storage c) the disk drive d) the USB drive
a) RAM
A compound Boolean expression created with the _______ operator is true only if both of its subexpressions are true a) and b) or c) not d) both
a) and
The ____________ translates an assembly language program to a machine language program a) assembler b) compiler c) translator d) interpretor
a) assembler
A ______________ is enough memory to store a letter of the alphabet or a small number a) byte b) bit c) switch d) transistor
a) byte
A design technique that helps to reduce the diplication of code within a program and is a benefit of using functions is ________ a) code reuse b) divide and conquer c) debugging d) facilitation of teamwork
a) code reuse
Short notes placed in different parts of a program explaining how those parts of the program work are called _______ a) comments b) reference manuals c) tutorials d) external documentation
a) comments
Validation loops are also known as: a) error traps b) doomsday loops c) error avoidance loops d) defensive loops
a) error traps
a _______ is a Boolean variable that signals when some condition exists in the program a) flag b) signal c) sentinal d) siren
a) flag
A _______ is a diagram that graphically depicts the steps that take place in a program a) flowchart b) step chart c) code graph d) program graph
a) flowchart
The physical devices that a computer is made of are referred to as ______. a) hardware b)software c) the operating system d) tools
a) hardware
This built-in function can be used to read input that has been typed on the keyboard a) input() b) get_input() c) read_input() d) keyboard()
a) input()
In the expression 12 + 7, the values on the right and left of the + symbol are called _______ a) operands b) operators c) arguments d) math expressions
a) operands
A video display is a(n) _______________ device a) output b) input c) secondary storage d) main memory
a) output
A(n) ________ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list. a) sentinel b) flag c) signal d) accumulator
a) sentinel
The rules that must be followed when writing a program are called _______________ a) syntax b) punctuation c) key words d) operators
a) syntax
Negative numbers are encoded using the__________technique a) two's complement b) floating point c) ASCII d) Unicode
a) two's complement
A _______ is a name that references a value in the computer's memory a) variable b) register c) RAM slot d) byte
a) variable
Which of the following statements will cause an error? a) x = 17 b) 17 = x c) x = 999999 d) x = '17'
b) 17 = x
A set of 128 numeric codes the represent the English letters, various punctuation marks, and other characters is __________ a) binary numbering b) ASCII c) Unicode d) ENIAC
b) ASCII
A component that collects data from people or other devices and sends it to the computer is called ___________________ a) an output device b) an input device c) a secondary storage device d) main memory
b) an input device
A(n) ____ makes a variable reference a value in the computer's memory a) variable declaration b) assignment statement c) math expression d) string literal
b) assignment statement
The -= operator is an example of a(n) __________ operator a) relational b) augmented assignment c) complex assignment d) reverse assignment
b) augmented assignment
In the _________ numbering system, all numeric values are written as sequences of 0s and 1s a) hexadecimal b) binary c) octal d) decimal
b) binary
You ________ the function to execute it a) define b) call c) import d) export
b) call
A(n) __________ program translates of high-level language program into a separate machine language program a) assembler b) compiler c) translator d) utility
b) compiler
A _________-controlled loop that that uses a true/false condition to control the number of times it repeats a) Boolean b) condition c) decision d) count
b) condition
In the _________ part of the fetch-decode-execute cycle, the CPU determine which operation it should perform a) fetch b) decode c) execute d) immediately after the instruction is executed
b) decode
Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of this data type a) int b) float c) currency d) str
b) float
This built-in function can be used to convert an int value to a float a) int_to_float() b) float() c) convert() d) int()
b) float()
Real numbers are encoded using the______technique a) two's complement b) floating point c) ASCII d) Unicode
b) floating point
GIGO stands for a) great input, great output b) garbage in, garbage out c) GIGahertz Output d) DIDabyte Operations
b) garbage in, garbage out
You use a(n) ________ statement in pseudocode to write a single alternative decision structure a) test-jump b) if c) if-else d) if-call
b) if
and, or, and not are _________ operators a) relational b) logical c) conditional d) ternary
b) logical
Today, CPUs are small chips known as ____________ a) ENIACs b) microprocessors c) memory chips d) operating ststems
b) microprocessors
a compound Boolean expression created with the __________ operator is true if either of its subexpressions is true a) and b) or c) not d) either
b) or
A(n) _______ is a set of instructions that a computer follows to perform a task. a) compiler b) program c) interpreter d) programming language
b) program
An informal language that has no syntax rules, and is not meant to be compiled or executed is called: a) faux code b) psuedocode c) Pthon d) a flowchard
b) pseudocode
A _______ structure provides one alternative path of execution a) sequence b) single alternative decision c) one path alternative d) single execution decision
b) single alternative decision
A _______ is a single function that the program must perform in order to satisfy the customer a) task b) software requirement c) prerequisite d) predicate
b) software requirement
If you were to look at a machine language program, you would see ___________________ a) Python code b) stream of binary numbers c) English words d) circuits
b) stream of binary numbers
A(n) ________ structure tests a condition and then takes one path if the condition is true or another path if the condition is false a) if statement b) single alternative decision c) dual alternative decision d) sequence
c) dual alternative decision
A group of statements that exist within a program for the purpose of performing a specific task is a(n) _________ a) block b) parameter c) function d) expression
c) function
You use a(n) ________ statement in pseudocode to write a dual alternative decision structure a) test-jump b) if c) if-else d) if-call
c) if-else
A(n) ___________ loop has no way of ending and repeats until the program is interrupted a) indeterminate b) indeterminable c) infinite d) timeless
c) infinite
The integrity of a program's output is only as good as the integrity of the program's: a) compiler b) programming language c) input d) debugger
c) input
A _____ error does not prevent the program from running, but causes it to produce incorrect results a) syntax b) hardware c) logic d) fatal
c) logic
Computers can only execute programs that are written in ________________ a) Java b) assembly language c) machine language d) Python
c) machine language
The computer stores a program while the programs is running, as well as the data that the program is working with, in _______________________ a) secondary storage b) the CPU c) main memory d) microprocessor
c) main memory
the ________ operator takes Boolean expressions as its operand and reverses its logical value a) and b) or c) not d) either
c) not
A type of memory that can hold data for long periods of time, even when there is no power to the computer, is called __________________ a) RAM b) main memory c) secondary storage d) CPU storage
c) secondary storage
A _______ is a sequence of characters that is u sed as data a) char sequence b) character collection c) string d) text block
c) string
This symbol marks the beginning of a comment in Python a) & b) * c) ** d) #
d) #
A(n) _________ expression has a value of true or false a) binary b) decision c) unconditional d) Boolean
d) Boolean
A(n) ________ variable keeps a running total a) sentinel b) sum c) total d) accumulator
d) accumulator
A(n) _______ is a set of well-defined logical steps that must be taken to perform a task a) logarithm b) plan of action c) logic schedule d) algorithm
d) algorithm
A byte is made up of eight __________ a) CPU's b) instructions c) variables d) bits
d) bits
A _________-controlled loop that repeats a specific number of times. A loop is known as a FOR loop a) Boolean b) condition c) decision d) count
d) count
A string literal in Python must be enclosed in a) parentheses b) single-quotes c) double-quotes d) either b or c
d) either b or c
The first line of a function definition is known as the ___________ a) body b) introduction c) initialization d) header
d) header
Each repetition of a loop is known as a(n) _______ a) cycle b) revolution c) orbit d) iteration
d) iteration
The words that make up a high-level programming language are called ___________ a) binary instructions b) mnemonics c) commands d) key words
d) key words
The tiny dots of colors that digital images are composed of are called _________________ a) bits b) bytes c) color packets d) pixels
d) pixels
The input operation that appears just before a validation loop is known as: a) prevalidation read b) primordial read c) initialization read d) priming read
d) priming read
The part of a computer that runs programs is called ________________ a) RAM b) secondary storage c) main memory d) the CPU
d) the CPU