6.5 Developing Algorithms Using Pseudocode Flashcards

1
Q
A

Less tham

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

<=

A

Less rhan or equal to

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

>

A

Greater than

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

> =

A

Gretaer than or equal to

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

==

A

Equal to

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

=

A

Assignment

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

!=

A

Not equal to

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

*

A

Multiply

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

Exponent

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

+

A

Addition (with int or float)

Concatenation (with strings)

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

If
Else if
Else

A

Branching

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

Switch case default

A

Branch depending on case

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

input(;

A

Get user inout

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

print()

A

Output to the user

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

for

A

Repeat a process for a set number of times

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

while

A

Repeaet while a condition is true

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

do untill

A

Do a loop untill a condition is true

18
Q

str()

A

Cast to string

19
Q

int()

A

Cast to integer

20
Q

INTEGER

A

Whole number

Eg: 1, 2, 3, 4

21
Q

REAL or FLOAT or DOUBLE

A

A number with a decimal point

Eg: 1.1, 1.2, 1.3, 1.4

22
Q

BOOLEAN

A

Either True or False

23
Q

CHARACTER

A

A single alphabetic or numeric character

Eg: ‘A’, ‘@’

24
Q

STRING

A

A sequence of one or more characters

25
LIST or ARRAY
A container that conrain more data | Eg: ['eggs', 'are', 'good']
26
DICTIONARY
Key value pairs | Eg: {'name': marc, 'age': 14}
27
Give some boolean operators
``` > >= < <= == != ```
28
100 > 10^2
False
29
n^2 == n*n
True
30
Pseudocode
Structurd english for descriving algorithms
31
Use of pseudocode
Allows a programmer to focus on the logic of the algorithm without being dristracted by syntax
32
Sequence
The statements are executed one by one, in the order they are written
33
Selection
The nest statement to be executed depends on whether the condition being tested is TRUE or FALSE
34
Switch/case
Used if there are several options to be tested
35
Assign a integer 5 to the variable x
x = 5
36
Assign an input for a person's username to a variable called y
y = input("What is your name? ")
37
Iteration
Repetition
38
Give examples of functions that use iteration
For While Do untill
39
Write a program that loops from 0 to 6 and prints out those numbers using iteration
for i in range(0, 7): | print(i)
40
Write a program that keeps asking for a password if its incorrect
password = input("Enter password") while password != "secret": print("incorrect password") password = input("Enter password")
41
Write a program that keeps asking for a password if its incorrect using a do untill loop
do: password = input("Enter password") until password == "secret" print("correct password")