cs chapter 5

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:29 PM on 10/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

What are the requirements of a well written algorithm

  • it should be free of logic errors

  • It should be easy to code in any high-level language


2
New cards

define execution

the process by which a computer carries out the instructions of a computer program

3
New cards

What are some uses of variables

  • controlling the number of times a loop is executed

  • determining which branch of an IF statement is taken

  • keeping running totals

  • holding user input


4
New cards

Do you need to specify data types of variables?

It is not necessary in pseudocode, however data types become much more important in high level language programming as the data type of a variable determines the operations that can be performed on it.


5
New cards

what is type coercion

the process of converting the value stored in a variable from one data type to another (implicitly)

Type coercion is when the data type of a variable changes during program execution (implicit so it happens automatically e.g if an integer and real value are used in a calculation the resulting value will be a real value)

6
New cards

what is type casting

the process of converting the value stored in a variable from one data type to another (explicitly)


Type casting is when the data type of a variable is converted during program execution (explicit so the user needs to state e.g may = int(x))


7
New cards

define initialize

to set variables to their starting values at the beginning of a program or subprogram

8
New cards

assignment statement

the command/ statement used to change the value of a variable that has been initialized


it is also the SET … TO command used to initialize variables in pseudocode

9
New cards

assignment statement

the command/ statement used to change the value of a variable that has been initialized


it is also the SET … TO command used to initialize variables in pseudocode

10
New cards

What does a variable (such as a loop counter) that is intended to hold a running total need to be in order to use it?

the variable should always be initialized to a starting values (e.g 0)

some programming languages won’t execute if the programmer fails to do this

others may execute but may well produce some unexpected results (logic error)

11
New cards

selection

a construct that allows a choice to be made between different alternatives

used to create a branch in a program

the computer selects which branch to follow based on the outcome of a condition

12
New cards

define nested IF statement

a nested IF statement consists of one or more IF statements placed inside each other. A nested IF statement is used when there are more than two possible courses of action


for Pearson edexcel pseudocode, when creating nested IF statements, you have to ensure that each one is completed with an END IF at the correct indentation level

13
New cards

what is order of precedence for logical operators ?

AND

NOT

OR

14
New cards

define relational operator

an operator that tests the relationship between two entities

15
New cards

define logical operator

a Boolean operator using AND, OR and NOT

16
New cards

definite iteration

when the number of iterations is known in advance

using a for loop (python + pseudocode) and repeat loop

17
New cards

nested loop

a loop within a loop

each iteration of the outer loop causes the inner loop to be executed until completion

18
New cards

indefinite iteration

when the number of iterations is not known in advance

repeated until specific condition is met

while loop (python) repeat until (pseudocode)

19
New cards

Random numbers

used to make an event random

python has a random module

(Import random

random has 3 different forms:

20
New cards

what happens when a variable is initialized

When a variable is declared, the computer gives it a location in its memory. Initially this location is empty so before a variable can be used, it has to be given a value