Python Final Exam

Ace your homework & exams now with Quizwiz!

This is a design tool that describes the input, processing, and output of a function. a. hierarchy chart b. IPO chart c. datagram chart d. data processing chart

IPO chart

If you were to look at a machine language program, you would see __________. a.Java code b.a stream of binary numbers c.English words d.circuits

a stream of binary numbers

A(n) __________ variable keeps a running total. a. sentinel b. sum c. total d. accumulator

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

algorithm

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

an input device

A magic number is ________________. a. a number that is mathematically undefined b. an unexplained value that appears in a program's code c. a number that cannot be divided by 1 d. a number that causes computers to crash

an unexplained value that appears in a program's code

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

and

A(n) __________ is a piece of data that is sent into a function. a. argument b. parameter c. header d. packet

argument

The __________ translates an assembly language program to a machine language program. a.assembler b.compiler c.translator d.interpreter

assembler

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

assignment statement

The -= operator is an example of a(n) __________ operator. a. relational b. augmented assignment c. complex assignment d. reverse assignment

augmented assignment

When a program is finished using a file, it should do this. a. erase the file b. open the file c. close the file d. encrypt the file

close the file

When working with this type of file, you can jump directly to any piece of data in the file without reading the data that comes before it. a. ordered access b. binary access c. direct access d. sequential access

direct access

A design technique that helps to reduce the duplication 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

divide and conquer

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

dual alternative decision

18. This statement causes a function to end and sends a value back to the part of the program that called the function. a. end b. send c. exit d. return

return

This is a math module function. a. derivative b. factor c. sqrt d. differentiate

sqrt

A __________ is a sequence of characters. a. char sequence b. character collection c. string d. text block

string

The rules that must be followed when writing a program are called __________. a.syntax b.punctuation c.key words d.operators

syntax

The contents of this type of file can be viewed in an editor such as Notepad. a. text file b. binary file c. English file d. human-readable file

text file

The part of a computer that runs programs is called __________. a.RAM b.secondary storage c.main memory d.the CPU

the CPU

A design technique that programmers use to break down an algorithm into functions is known as __________. a. top-down design b. code simplification c. code refactoring d. hierarchical subtasking

top-down design

Negative numbers are encoded using the __________ technique. a.two's complement b.floating-point c.ASCII d.Unicode

two's complement

A __________ is any hypothetical person using a program and providing input for it. a. designer b. user c. guinea pig d. test subject

user

A __________ is a name that references a value in the computer's memory. a. variable b. register c. RAM slot d. byte

variable

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

secondary storage

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

sentinel

When working with this type of file, you access its data from the beginning of the file to the end of the file. a. ordered access b. binary access c. direct access d. sequential access

sequential access

A __________ structure provides one alternative path of execution. a. sequence b. single alternative decision c. one path alternative d. single execution decision

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

software requirement

This standard library function returns a random floating-point number within a specified range of values. a. random b. randint c. random_integer d. uniform

uniform

A(n) __________ expression has a value of either True or False. a. binary b. decision c. unconditional d. Boolean

Boolean

This type of function returns either True or False. a. Binary b. true_false c. Boolean d. logical

Boolean

This is a volatile type of memory that is used only for temporary storage while a program is running. a.RAM b.secondary storage c.the disk drive d.the USB drive

RAM

An extensive encoding scheme that can represent the characters of many of the languages in the world is __________. a.binary numbering b.ASCII c.Unicode d.ENIAC

Unicode

This operator performs integer division. a. // b. % c. ** d. /

//

A bit that is turned off represents the following value: __________. a.1 b.-1 c.0 d."no"

0

Which of the following statements will cause an error? a. x = 17 b. 17 = x c. x = 99999 d. x = '17'

17 = X

In a(n) __________ numbering system, all numeric values are written as sequences of 0s and 1s. a.hexadecimal b.binary c.octal d.decimal

binary

This type of file contains data that has not been converted to text. a. text file b. binary file c. Unicode file d. symbolic file

binary file

A byte is made up of eight __________. a.CPUs b.instructions c.variables d.bits

bits

A __________ is enough memory to store a letter of the alphabet or a small number. a.byte b.bit c.switch d.transistor

byte

You __________ a function to execute it. a. define b. call c. import d. export

call

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

comments

A(n) __________ program translates a high-level language program into a separate machine language program. a.assembler b.compiler c.translator d.utility

compiler

A __________ -controlled loop uses a true/false condition to control the number of times that it repeats. a. Boolean b. condition c. decision d. count

condition

A __________ -controlled loop repeats a specific number of times. a. Boolean b. condition c. decision d. count

count

A __________ structure can execute a set of statements only under certain circumstances. a. sequence b. circumstantial c. decision d. Boolean

decision

In the __________ part of the fetch-decode-execute cycle, the CPU determines which operation it should perform. a.fetch b.decode c.execute d.immediately after the instruction is executed

decode

A file that data is read from is known as a(n) . a. input file b. output file c. sequential access file d. binary file

input file

Which 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()

input()

Each repetition of a loop is known as a(n) __________. a. cycle b. revolution c. orbit d. iteration

iteration

This is a prewritten function that is built into a programming language. a. standard function b. library function c. custom function d. cafeteria function

library function

A __________ is a variable that is created inside a function. a. global variable b. local variable c. hidden variable d. none of the above; you cannot create a variable inside a function

local variable

A __________ error does not prevent the program from running, but causes it to produce incorrect results. a. syntax b. hardware c. logic d. fatal

logic

and, or, and not are __________ operators. a. relational b. logical c. conditional d. ternary

logical

Computers can only execute programs that are written in __________. a.Java b.assembly language c.machine language d.C++

machine language

The computer stores a program while the program is running, as well as the data that the program is working with, in __________. a.secondary storage b.the CPU c.main memory d.the microprocessor

main memory

Today, CPUs are small chips known as __________. a.ENIACs b.microprocessors c.memory chips d.operating systems

microprocessors

The words that make up a high-level programming language are called __________. a.binary instructions b.mnemonics c.commands d.key words

mnemonics

A __________ is a name that represents a value that does not change during the program's execution. a. named literal b. named constant c. variable signature d. key term

named constant

11. The ___________ operator takes a Boolean expression as its operand and reverses its logical value. a. and b. or c. not d. either

not

Before a file can be used by a program, it must be . a. formatted b. encrypted c. closed d. opened

opened

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

operands

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

or

A video display is a(n) __________. a.output device b.input device c.secondary storage device d.main memory

output device

A file that data is written to is known as a(n) __. a. input file b. output file c. sequential access file d. binary file

output file

A(n) __________ is a special variable that receives a piece of data when a function is called. a. argument b. parameter c. header d. packet

parameter

The _____________ keyword is ignored by the Python interpreter and can be used as a placeholder for code that will be written later. a. placeholder b. pass c. pause d. skip

pass

The tiny dots of color that digital images are composed of are called __________. a.bits b.bytes c.color packets d.pixels

pixels

The while loop is a __________ type of loop. a. pretest b. no-test c. prequalified d. post-iterative

pretest

The input operation that appears just before a validation loop is known as the _________________. a. prevalidation read b. primordial read c. initialization read d. priming read

priming read

A(n) __________ is a set of instructions that a computer follows to perform a task. a.compiler b.program c.interpreter d.programming language

program

An informal language that has no syntax rules and is not meant to be compiled or executed is called __________. a. faux code b. pseudocode c. Python d. a flowchart

pseudocode

This standard library function returns a random integer within a specified range of values. a. random b. randint c. random_integer d. uniform

randint

This standard library function returns a random floating-point number in the range of 0.0 up to 1.0 (but not including 1.0). a. random b. randint c. random_integer d. uniform

random

The symbols >, <, and == are all __________ operators. a. relational b. logical c. conditional d. ternary

relational

A(n) __________ is the part of a program in which a variable may be accessed. a. declaration space b. area of visibility c. scope d. mode

scope

This symbol marks the beginning of a comment in Python. a. & b. * c. ** d. #

#

This operator performs division, but instead of returning the quotient it returns the remainder. a. % b. * c. ** d. /

%

a. % b. * c. ** d. /

**

A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is __________. a.binary numbering b.ASCII c.Unicode d.ENIAC

ASCII

A string literal in Python must be enclosed in __________. a. parentheses. b. single-quotes. c. double-quotes. d. either single-quotes or double-quotes.

either single-quotes or double-quotes

Validation loops are also known as . a. error traps b. doomsday loops c. error avoidance loops d. defensive loops

error traps

A ___________ is a Boolean variable that signals when some condition exists in the program. a. flag b. signal c. sentinel d. siren

flag

Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of which data type? a. int b. float c. currency d. str

float

Which built-in function can be used to convert an int value to a float? a. int_to_float() b. float() c. convert() d. int()

float()

Real numbers are encoded using the __________ technique. a.two's complement b.floating-point c.ASCII d.Unicode

floating-point

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

flowchart

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

function

GIGO stands for . a. great input, great output b. garbage in, garbage out c. GIGahertz Output d. GIGabyte Operation

garbage in, garbage out

When possible, you should avoid using __________ variables in a program. a. local b. global c. reference d. parameter

global

A variable that is visible to every function in a program file is a __________. a. local variable b. universal variable c. program-wide variable d. global variable

global variable

The physical devices that a computer is made of are referred to as __________. a.hardware b.software c.the operating system d.tools

hardware

The first line of a function definition is known as the __________. a. body b. introduction c. initialization d. header

header

A __________ is a diagram that gives a visual representation of the relationships between functions in a program. a. flowchart b. function relationship chart c. symbol chart d. hierarchy chart

hierarchy chart

You use a(n) __________ statement to write a single alternative decision structure. a. test-jump b. if c. if-else d. if-call

if

You use a(n) __________ statement to write a dual alternative decision structure. a. test-jump b. if c. if-else d. if-call

if-else

A(n) __________ loop has no way of ending and repeats until the program is interrupted. a. indeterminate b. interminable c. infinite d. timeless

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

input


Related study sets

Chapter 25: America in a World at War

View Set

Smartbook Reading Chapter Eight- Managment

View Set

MIS Chapter 7 E-Business and E-Commerce

View Set

Chapter 18 The Progressive movement Study Guide

View Set

H&C Prep U CH: 46 Management of Patients With Gastric and Duodenal Disorders

View Set