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.

24
Q

The ____ statement is used to create a decision structure

25
In flowcharting, which symbol is used to represent a Boolean expression?
A diamond
26
Which decision structure provides only one alternative path of execution?
A single alternative decision structure.
27
In a decision structure, the action is _______executed because it is performed only when a specific condition is true?
Conditionally
28
Which operator determines whether a specific relationship exists between to values?
A relational operator
29
What statement will execute one block of statements if its condition is true or another block if its condition is false?
An if-else statement
30
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.
if-elif-else
31
Which logical operator reverses the truth of a boolean expression?
The not operator
32
What kind of expression is made up of two or more boolean expressions?
A compound expression
33
What kind of structure causes a set of statements to execute repeatedly?
A repetition structure
34
A _________ controlled loop causes a statement or set of statements to repeat as long as the condition is true.
A condition controlled loop
35
What loop is known as the pretest loop because it tests the condition before performing an iteration?
The while loop.
36
What kind of loop usually occurs when the programmer does not include code inside the loop that makes the test condition false?
An infinite loop
37
In python, you would use the ____ statement to write a count-controlled loop.
for
38
A(n) ______ total is a sum of numbers that accumulates with each iteration of the loop.
running
39
A(n) _____ is a special value that marks the end of a sequence of items
sentinel
40
The acronym _______ refers to the fact that the computer cannot tell the difference between good data and bad data.
GIGO (Garbage in, Garbage out)
41
A(n) _______ validation loop is sometimes called an error trap or error handler.
Input
42
The ______ function is a built-in function that generates a list of integer values
range
43
The following for loop iterates ______ times to draw a square. for x in range (4): turtle.forward(200) turtle.right(90)
four times
44
The code for a function is known as a function _____
definition (def)
45
The function header begins with the keyword ____ and is followed by the name of the function.
def
46
The _____ function contains a program’s mainline logic which is the overall logic of the program
main
47
In a flowchart, a function call is depicted by a ______
rectangle
48
Functions that are in the standard library are stored in files that are known as ______
modules
49
To refer to a function in module, python uses what kind of notation? ex: random.randint
dot notation
50
A value-returning function has a ______ statement that sends a value back to the part of the program that called it
return
51
In python, a module’s file name should end in
.py
52
The approach known as _________ makes a program easier to understand , test, and maintain
modularization