EE 186: Intro to Programing Midterm 1

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/91

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

92 Terms

1
New cards

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

2
New cards

The physical devices that a computer is made of are referred to as________.

a. hardware

b. software

c. the operating system

d. tools

hardware

3
New cards

The part of a computer that runs programs is called________.

a. RAM

b. secondary storage

c. main memory

d. the CPU

the CPU

4
New cards

Today, CPUs are small chips known as________.

a. ENIACs

b. microprocessors

c. memory chips

d. operating systems

microprocessors

5
New cards

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

6
New cards

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

7
New cards

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

d. secondary storage

d. CPU storage

secondary storage.

8
New cards

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

9
New cards

A video display is a(n)________device.

a. output

b. input

c. secondary storage

d. main memory

output

10
New cards

A_______is enough memory to store a letter of the alphabet or a small number.

a. byte

b. bit

c. switch

d. transistor

byte

11
New cards

A byte is made up of eight________.

a. CPUs

b. instructions

c. variables

d. bits

bits

12
New cards

In the_____numbering system, all numeric values are written as sequences of 0s and 1s.

a. hexadecimal

b. binary

c. octal

d. decimal

binary

13
New cards

A bit that is turned off represents the following value:______.

a. 1

b. −1

c. 0

d. “no”

0

14
New cards

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

15
New cards

An extensive encoding scheme that can represent characters for many languages in the world is_______.

a. binary numbering

b. ASCII

c. Unicode

d. ENIAC

Unicode

16
New cards

Negative numbers are encoded using the_______technique.

a. two’s complement

b. floating point

c. ASCII

d. Unicode

two’s complement

17
New cards

Real numbers are encoded using the_________technique.

a. two’s complement

b. floating point

c. ASCII

d. Unicode

floating point

18
New cards

The tiny dots of color that digital images are composed of are called__________.

a. bits

b. bytes

c. color packets

d. pixels

pixels

19
New cards

If you were to look at a machine language program, you would see_________.

a. Python code

b. a stream of binary numbers

c. English words

d. circuits

a stream of binary numbers

20
New cards

In the__________part of the fetch-decode-execute cycle, the CPU determines which operation it should perform.

a. fetch

b. decode

c. execute

d. deconstruct

decode

21
New cards

Computers can only execute programs that are written in_________.

a. Java

b. assembly language

c. machine language

d. Python

machine language

22
New cards

The______translates an assembly language program to a machine language program.

a. assembler

b. compiler

c. translator

d. interpreter

assembler

23
New cards

The words that make up a high-level programming language are called______.

a. binary instructions

b. mnemonics

c. commands

d. keywords

keywords

24
New cards

The rules that must be followed when writing a program are called_______.

a. syntax

b. punctuation

c. keywords

d. operators

syntax

25
New cards

A(n)________program translates a high-level language program into a separate machine language program.

a. assembler

b. compiler

c. translator

d. utility

compiler

26
New cards

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

27
New cards

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

28
New cards

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

29
New cards

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

30
New cards

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

31
New cards

A_______is a sequence of characters.

a. char sequence

b. character collection

c. string

d. text block

string

32
New cards

A________is a name that references a value in the computer’s memory.

a. variable

b. register

c. RAM slot

d. byte

variable

33
New cards

A_________is any hypothetical person using a program and providing input for it.

a. designer

b. user

c. guinea pig

d. test subject

user

34
New cards

A string literal in Python must be enclosed________.

a. parentheses.

b. single-quotes.

c. double-quotes.

d. either single-quotes or double-quotes.

either single-quotes or double quotes

35
New cards

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

36
New cards

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

37
New cards

This symbol marks the beginning of a comment in Python.

a. &

b. *

c. **

d. #

#

38
New cards

Which of the following statements will cause an error?

a. x = 17

b. 17 = x

c. x = 99999

d. x = '17'

17 = x

39
New cards

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

40
New cards

This operator performs integer division.

a. //

b. %

c. **

d. /

//

41
New cards

This is an operator that raises a number to a power.

a. %

b. *

c. **

d. /

**

42
New cards

This operator performs division, but instead of returning the quotient it returns the remainder.

a. %

b. *

c. **

d. /

%

43
New cards

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

44
New cards

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

45
New cards

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

46
New cards

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

47
New cards

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

48
New cards

A_________structure can execute a set of statements only under certain circumstances.

a. sequence

b. circumstantial

c. decision

d. Boolean

decision

49
New cards

A____________structure provides one alternative path of execution.

a. sequence

b. single alternative decision

c. one path alternative

d. single execution decision

single execution decision

50
New cards

A(n)__________expression has a value of either True or False.

a. binary

b. decision

c. unconditional

d. Boolean

Boolean

51
New cards

The symbols >, <, and == are all___________operators.

a. relational

b. logical

c. conditional

d. ternary

relational

52
New cards

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

53
New cards

You use a(n)__________statement to write a single alternative decision structure.

a. test-jump

b. if

c. if-else

d. if-call

if

54
New cards

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

55
New cards

and, or, and not are__________operators.

a. relational

b. logical

c. conditional

d. ternary

logical

56
New cards

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

57
New cards

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

58
New cards

The___________operator takes a Boolean expression as its operand and reverses its logical value.

a. and

b. or

c. not

d. either

not

59
New cards

A__________is a Boolean variable that signals when some condition exists in the program.

a. flag

b. signal

c. sentinel

d. siren

flag

60
New cards

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

61
New cards

A_________-controlled loop repeats a specific number of times.

a. Boolean

b. condition

c. decision

d. count

count

62
New cards

Each repetition of a loop is known as a(n)__________.

a. cycle

b. revolution

c. orbit

d. iteration

iteration

63
New cards

The while loop is a_________type of loop.

a. pretest

b. no-test

c. prequalified

d. post-iterative

pretest

64
New cards

A(n)_________loop has no way of ending and repeats until the program is interrupted.

a. indeterminate

b. interminable

c. infinite

d. timeless

infinite

65
New cards

The -= operator is an example of a(n)________operator.

a. relational

b. augmented assignment

c. complex assignment

d. reverse assignment

augmented assignment

66
New cards

A(n)_________variable keeps a running total.

a. sentinel

b. sum

c. total

d. accumulator

accumulator

67
New cards

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

68
New cards

GIGO stands for_________.

a. great input, great output

b. garbage in, garbage out

c. GIGahertz Output

d. GIGabyte Operation

garbage in, garbage out

69
New cards

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

70
New cards

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

71
New cards

Validation loops are also known as_______.

a. error traps

b. doomsday loops

c. error avoidance loops

d. defensive loops

error traps

72
New cards

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

73
New cards

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

code reuse

74
New cards

The first line of a function definition is known as the_________.

a. body

b. introduction

c. initialization

d. header

header

75
New cards

You_________a function to execute it.

a. define

b. call

c. import

d. export

call

76
New cards

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

77
New cards

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

78
New cards

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

79
New cards

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

80
New cards

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

81
New cards

A(n)________is a piece of data that is sent into a function.

a. argument

b. parameter

c. header

d. packet

argument

82
New cards

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

83
New cards

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

84
New cards

When possible, you should avoid using_______variables in a program.

a. local

b. global

c. reference

d. parameter

global

85
New cards

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

86
New cards

This standard library function returns a random integer within a specified range of values.

a. random

b. randint

c. random_integer

d. uniform

randint

87
New cards

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

88
New cards

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

89
New cards

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

90
New cards

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

91
New cards

This type of function returns either True or False.

a. Binary

b. true_false

c. Boolean

d. logical

Boolean

92
New cards

This is a math module function.

a. derivative

b. factor

c. sqrt

d. differentiate

sqrt