Do Now Activity Whiteboards Write an algorithm to

Do Now Activity - Whiteboards Write an algorithm to explain how to order food from a fast food drive through. • The algorithm should include the following tasks: Algorithm step-by-step solution to the problem 11/01/2022 – Order food – Pay for food – Collect food • In order to work this out, you need to decompose this problem into different tasks Good – Plan an algorithm using sequence, selection and iteration Outstanding – Refine an algorithm to make it more efficient

Unit 8 Algorithms Lesson 4 – Pseudocode Good – Plan an algorithm using sequence, selection and iteration Outstanding – Refine an algorithm to make it more efficient Computational Thinking = A way to take a complex problem, understand what the problem is and develop possible solutions.

Representing an Algorithm: Pseudocode 11/01/2022 • Pseudocode is not a programming language, it is a simple way of describing a set of instructions that does not have to use specific syntax. • Writing in pseudocode is similar to writing in a programming language. Each step of the algorithm is written on a line of its own in sequence. • Usually, instructions are written in uppercase, variables in lowercase and “strings” in quotation marks. Good – Plan an algorithm using sequence, selection and iteration Outstanding – Refine an algorithm to make it more efficient

Task 1: - Whiteboards 11/01/2022 Are you old enough to drive? Write an algorithm that checks if a user is old enough to drive a car. • The program should first ask the user for their age. • If the user’s age is greater than or equal to 17, output a message to confirm the user is old enough to drive. • If the user is not old enough, output a suitable message to let them know. • In order to work this out, you will need to include tasks, inputs, outputs and a decision. Good – Plan an algorithm using sequence, selection and iteration • • Make it Outstanding! Store the user’s age in a variable. Compare the age variable within the decision. Use accurate indentation within your pseudocode. Write your strings in quotation marks Outstanding – Refine an algorithm to make it more efficient

Pseudocode Task 1 – Page 7 11/01/2022 Planning a program that asks people what the best subject they take is, would look like this in pseudocode. Explain what each step of the code does below REPEAT OUTPUT 'What is the best subject? ' INPUT user inputs the best subject STORE the user's input in the answer variable IF answer = 'Computer Science' THEN OUTPUT 'Of course it is!' ELSE OUTPUT 'Try again!' UNTIL answer = 'Computer Science' Good – Plan an algorithm using sequence, selection and iteration Outstanding – Refine an algorithm to make it more efficient

Do Now Activity – Whiteboards 17 9 4 11/01/2022 -12 3 39 • Use an insertion sort on these numbers (Low to high) • On the other side of the whiteboard use a merge sort (Low to high) Good – Plan an algorithm using sequence, selection and iteration Outstanding – Refine an algorithm to make it more efficient
- Slides: 6