Search Header Logo
Higher SDD - Count occurrences

Higher SDD - Count occurrences

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

G Alexander-Doyle

Used 2+ times

FREE Resource

16 Slides • 5 Questions

1

media

2

media

Aims  

We are learning how to implement a count occurrence algorithm which traverse arrays or arrays of records 

  

Achievements (theory)  

  • I can write the code required to implement the standard algorithms in Python. Specifically, I can:  

  • initialise and update variables  

  • loop through an array/array of records with a fixed or conditional loop  

  • set up a condition to test a criteria  

  • return the position of a given piece of data within and array/array of records  

  • I can predict the how the values of variables will change during the execution of a standard algorithm  

  

Achievements (practical)  

  • I can implement a count occurrence algorithm in Python.  

3

media

4

media

5

media

6

Match

Match the construct with the description below.

Assignment

Selection

Fixed iteration

Conditional iteration

Updates or initialises a variable

Performs an action when a condition is m

Repeats code a set number of times

Repeats code until a condition is met

7

Categorize

Options (20)

average = total/10

total = 0

count = count + 1

if age > 18:

Set result to num1 + num2

name = 'John'

if temperature < 30:

if status == 'active':

if grade >= 60:

if day == 'Monday':

for i in range(10):

repeat 5 times:

for counter in range (number):

while count <= 10:

while found == False:

Repeat ... Until found = True

while score <0 or score >100:

Repeat ... until found = Tru or end of list

for x in range (len(array)):

for each pupil in pupils_array do

Categorise the lines of code into the correct construct.

Assignment
Selection
Fixed iteration
Conditional iteration

8

media

9

media

10

Reorder

Put the constructs in a Higher Standard algorithm into the correct order.

Set up variables

Loop through the array

If statement

Update variables

End of algorithm / Extras

1
2
3
4
5

11

media

12

media

13

media

14

Open Ended

Question image

What would be the output from this program if the name "Callum" were entered by the user?

15

media
media

16

media

17

media

18

media

19

Open Ended

Question image

What would be the output from this program if the name the number were entered by the user?

20

media

Aims  

We are learning how to implement a count occurrence algorithm which traverse arrays or arrays of records 

  

Achievements (theory)  

  • I can write the code required to implement the standard algorithms in Python. Specifically, I can:  

  • initialise and update variables  

  • loop through an array/array of records with a fixed or conditional loop  

  • set up a condition to test a criteria  

  • return the position of a given piece of data within and array/array of records  

  • I can predict the how the values of variables will change during the execution of a standard algorithm  

  

Achievements (practical)  

  • I can implement a count occurrence algorithm in Python.  

21

media
media

Show answer

Auto Play

Slide 1 / 21

SLIDE