Chapter 2 Flashcards

1
Q

Program development cycle:

A

-design the program
-write the code
-correct syntax errors
-test the program
-correct logic errors

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

Most important part of the program development cycle

A

design

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

What is algorithm?

A

Set of well-defined logical steps that must be taken to perform a task

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

What is pseudocode?

A

Fake code

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

What is Flowchart?

A

A diagram that graphically depicts the steps in a program

-Ovals are terminal symbols
-Parallelograms are input and output symbols
-Rectangles are processing symbols
-Symbols are connected by arrows that represent the flow of the program

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

What three-step process do computers typically perform?

A

-Receive input
Input: any data that the program receives while it is running
-Perform some process on the input
Ex: mathematical calculation
-Produce output

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

A piece of prewritten code that performs an operation

A

Function

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

What displays output on the screen?

A

The print function

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

Data given to the function

A

Argument

Ex. data that is printed to screen

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

A sequence of characters that is used as data

A

String

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

String that appears in actual code of a program

A

String literal

-Must be enclosed in a single (‘) or double (“) quote marks

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

Notes of explanation within a program

A

Comments

-Intended for a person reading the programs code
-Being with #

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

What appears at the end of a line code?

A

End-line comment

-typically explains the purpose of that line

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

Name that represents a value stored in the computer memory

-Used to access and manipulate data stored in memory
-References the value it represents

A

Variable

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

Used to create a variable and make it reference data

-General format is variable = expression
Ex: age = 29
Assignment operator: the equal sign (=)

A

Assignment statement

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

Removal of values that are no longer referenced by variables. Carried out by Python interpreter.

A

Garbage collection

17
Q

Data Types

A

Categorize value in memory

e.g. int for integer, float for real number, str used for storing strings in memory

18
Q

Number written in program

-no decimal point considered int, otherwise, considered float

A

Numeric literal

19
Q

Raises a number to a power
Ex: x ** y = x^y

A

Exponent operator (**)

20
Q

Performs division and returns the remainder
aka modulus operator
Ex: 4%2=0, 5%2=1

A

Remainder operator (%)

21
Q

Allows to break a statement into multiple lines

result = var1 * 2 + var2 * 3 + \
var3 * 4 + var4 * 5

A

Multiline continuation character ()

22
Q

An unexplained numeric value that appears in a programs code

Ex: amount = balance * 0.069

A

Magic number