Component parts of a problem: processes

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Component parts of a problem: processes

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which of these is a PROCESS in a quiz program?
A Typing in the student's name on the keyboard
B Adding up the marks to get a total score
2. A school canteen program checks whether a pupil's balance is below £2. What is this?
A A process: comparing a value with a limit
B An output: showing a value on the screen
3. Which statement about processes is correct?
A A process is data the user types into the solution
B A process works on data the solution already has
4. A program puts a list of 30 test scores into order from highest to lowest. What is this?
A Process: sorting
B Storage: sorting
5. Which is the better process to list for a program that finds a pupil's mark in a list of results?
A Searching the list for the pupil's name
B Displaying the pupil's mark on the screen

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1total ← price * quantity AShowing the total on screen is an output, not a process. Calculating the total is the process.
2IF score >= limit THEN BA process that calculates a total by multiplying two stored values
3A process that adds up values to calculate a running total CIF speed > 60 THEN
4A process that checks whether a value is over a limit Dtotal ← total + mark
5Processes: name, age, score EThese are inputs (data), not processes. A process is an action such as adding, comparing or sorting.
6Process: OUTPUT total FA process that compares a value with a limit to make a decision

Definitions

process

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Total ← Total _ Price
2.
IF Speed _ Limit THEN OUTPUT "Too fast" ENDIF
3.
FOR Count ← 1 TO 5 Total ← Total + Mark ____ Count
4.
IF Name = Target THEN Found ← ____ ENDIF
5.
Temp ← A A ← B B ← ____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A total ← 0
B FOR i ← 1 TO 5
C INPUT mark
D total ← mark
E NEXT i
Question 2
A IF speed < limit THEN
B OUTPUT "Too fast"
C ENDIF
Question 3
A count ← 0
B FOR i ← 1 TO 10
C IF score[i] ← 50 THEN
D count ← count + 1
E ENDIF
F NEXT i
Question 4
A total ← 1
B FOR i ← 1 TO 4
C total ← total + price[i]
D NEXT i
E OUTPUT total
Question 5
A found ← FALSE
B FOR i ← 1 UNTIL 10
C IF name[i] = target THEN
D found ← TRUE
E ENDIF
F NEXT i

Answer Key

Component parts of a problem: processes
Section A: Quick Questions
Q1
B — Adding up the marks to get a total score
Q2
A — A process: comparing a value with a limit
Q3
B — A process works on data the solution already has
Q4
A — Process: sorting
Q5
A — Searching the list for the pupil's name
Section B: Match the Pairs
Q1
total ← price * quantity → A process that calculates a total by multiplying two stored values
Q2
IF score >= limit THEN → A process that compares a value with a limit to make a decision
Q3
A process that adds up values to calculate a running total → total ← total + mark
Q4
A process that checks whether a value is over a limit → IF speed > 60 THEN
Q5
Processes: name, age, score → These are inputs (data), not processes. A process is an action such as adding, comparing or sorting.
Q6
Process: OUTPUT total → Showing the total on screen is an output, not a process. Calculating the total is the process.
Section C: Definitions
Q1
process — An action or calculation a solution carries out on its data, such as adding a total, comparing a value with a limit, sorting or searching, or making a decision.
Section D: Fill in the Blanks
Q1
Total ← Total + Price
Q2
IF Speed > Limit THEN OUTPUT "Too fast" ENDIF
Q3
FOR Count ← 1 TO 5 Total ← Total + Mark NEXT Count
Q4
IF Name = Target THEN Found ← TRUE ENDIF
Q5
Temp ← A A ← B B ← Temp
Section E: Spot the Error
Q1
D — Calculating a total is a process. Each loop must ADD the new mark to the running total (total ← total + mark). Writing total ← mark overwrites the total every time.
Q2
A — Comparing a value with a limit is a process. The warning should show when speed is greater than the limit, so the test must be speed > limit, not speed < limit.
Q3
C — The ← symbol is for assignment, not comparison. The process compares each score with the pass mark, so it needs a comparison operator such as score[i] >= 50.
Q4
A — The total must start at 0 before the adding process begins. Starting at 1 makes the final total wrong by 1.
Q5
B — A searching process checks each item in a loop. A FOR loop uses the keyword TO, so it should be FOR i ← 1 TO 10.