Midterm (Chapters 1-5) Flashcards

1
Q

A ______ Is a set of instructions that a computer will follow to perform a task.

A

Program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The term hardware refers to

A

All the physical devices that make up a computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The CPU (Central Processing Unit) is the part of the computer that

A

actually runs programs and is the most important component in a computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a disk drive store data

A

Magnetically by encoding it onto a circular disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are microprocessors

A

Small central processing unit chips

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the type of memory that can hold data for a long period of time? EVEN if there is no power to the computer

A

Secondary storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Main Memory is known as

A

RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do USB drives store data

A

Using flash memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Is python an interpreter or compiler?

A

Python is an interpreter that can read python programming statements and execute them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In which mode does the interpreter read the contents of a file that contains python statements and executes each statement?

A

Script mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the output of the following statement?
print(‘I\’m ready to begin’)

A

I’m ready to begin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the output of the following statement, given that value1 = 2.0 and value 2 = 12?

print(value1*value2)

A

24.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the output of the following statement?

print(‘The path is D:\sample\test.’)

A

The path is D:\sample\test.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the notes of explanation that document lines or sections of a program?

A

Comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What symbol is the remainder operator? What is it also known as?

A

%, it is also known as the modulus (mod) operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What character is a special character that is preceded with a backslash (), appearing inside a string literal?

A

An escape character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What specifier is a special set of characters that specify how a value should be formatted?

A

The formatting specifier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

When applying what formatting specifier to the number 76.15854 will it result in 76.159?

A

the .3f formatting specifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a software requirement?

A

a single task that the program must perform in order to satisfy the customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In the expression 12.45 + 3.6 the values to the right and left of the + symbol are what?

A

They are the operands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a name that represents a stored value in the computer’s memory?

A

A variable

22
Q

Python uses what to categorize values in memory?

A

Data types.

23
Q

A _______ is a name that represents a value that cannot be changed during a program’s execution.

A

Constant

24
Q

The ____ statement is used to create a decision structure

A

if

25
Q

In flowcharting, which symbol is used to represent a Boolean expression?

A

A diamond

26
Q

Which decision structure provides only one alternative path of execution?

A

A single alternative decision structure.

27
Q

In a decision structure, the action is _______executed because it is performed only when a specific condition is true?

A

Conditionally

28
Q

Which operator determines whether a specific relationship exists between to values?

A

A relational operator

29
Q

What statement will execute one block of statements if its condition is true or another block if its condition is false?

A

An if-else statement

30
Q

Python provides a special version of a decision structure known as the __________ statement, which makes the logic of the nested decision structure simpler to write.

A

if-elif-else

31
Q

Which logical operator reverses the truth of a boolean expression?

A

The not operator

32
Q

What kind of expression is made up of two or more boolean expressions?

A

A compound expression

33
Q

What kind of structure causes a set of statements to execute repeatedly?

A

A repetition structure

34
Q

A _________ controlled loop causes a statement or set of statements to repeat as long as the condition is true.

A

A condition controlled loop

35
Q

What loop is known as the pretest loop because it tests the condition before performing an iteration?

A

The while loop.

36
Q

What kind of loop usually occurs when the programmer does not include code inside the loop that makes the test condition false?

A

An infinite loop

37
Q

In python, you would use the ____ statement to write a count-controlled loop.

A

for

38
Q

A(n) ______ total is a sum of numbers that accumulates with each iteration of the loop.

A

running

39
Q

A(n) _____ is a special value that marks the end of a sequence of items

A

sentinel

40
Q

The acronym _______ refers to the fact that the computer cannot tell the difference between good data and bad data.

A

GIGO (Garbage in, Garbage out)

41
Q

A(n) _______ validation loop is sometimes called an error trap or error handler.

A

Input

42
Q

The ______ function is a built-in function that generates a list of integer values

A

range

43
Q

The following for loop iterates ______ times to draw a square.

for x in range (4):
turtle.forward(200)
turtle.right(90)

A

four times

44
Q

The code for a function is known as a function _____

A

definition (def)

45
Q

The function header begins with the keyword ____ and is followed by the name of the function.

A

def

46
Q

The _____ function contains a program’s mainline logic which is the overall logic of the program

A

main

47
Q

In a flowchart, a function call is depicted by a ______

A

rectangle

48
Q

Functions that are in the standard library are stored in files that are known as ______

A

modules

49
Q

To refer to a function in module, python uses what kind of notation?

ex: random.randint

A

dot notation

50
Q

A value-returning function has a ______ statement that sends a value back to the part of the program that called it

A

return

51
Q

In python, a module’s file name should end in

A

.py

52
Q

The approach known as _________ makes a program easier to understand , test, and maintain

A

modularization