150 likes | 163 Views
Code for the Cup. Starter Activity. OBJECTIVES: Computational thinking and code efficiency. Code a solution to be fit for purpose. Know the importance of code efficiency. Learn to detect and correct errors and refine programs. KEY WORDS. Program: Sequences of instructions for a computer.
E N D
OBJECTIVES: Computational thinking and code efficiency • Code a solution to be fit for purpose. • Know the importance of code efficiency. • Learn to detect and correct errors and refine programs.
KEY WORDS • Program:Sequences of instructions for a computer. • Sequence: Creating a set of instructions to complete a task. • Programming:writing computer code to create a program, to solve a problem. • Efficient: does it solve the problem, making best use of the available resources (eg as quickly as possible/using least space)? • Testing:is used to see how well a program works in meeting the objective. • Statement: The smallest element of a programming language which expresses an action to be carried out.
CODE - Can you get across the start line? • Activity: • Open 'Code for the Cup' game. • Using only 'rotate' and 'sail' can you connect them to get your boat across the start line? NOTE: You can use multiple copies of the sail and rotate blocks to get to the line.
EFFICIENCY – Which is the most efficient code and why? • Discussion: • Efficient – Solves the problem, making best use of the available resources.
EFFICIENCY – Which is the most efficient code and why? Results:
DASHBOARD DATA Countdown to Start Boat Speed Direction of Sail
DEVELOPING - Are you using your zones? • Discussion: • Green - optimum direction, allows you to travel up to 3x the wind speed. • Orange - you will be slower here than in the green zone. • Red - not good - you will lose speed or capsize. CHALLENGE: Modify and run your code - how fast can you get the boat to go?
DEVELOPING - Can you make your boat go faster? • Activity: • Drag your old code in the waste bin. • Make a new program using the original blocks but this time include the 'engage Foils' block as well. • Challenge: • What is the fastest boat speed you can achieve with your new code? • Can you get your boat over 40 knots? TIP: The Hydrofoils do not work until the boat reaches 18 Knots (KN)
TESTING - Test your model • Activity: • Identify four code changes that you could make to your program to further improve it. • Are your angles making the most efficient use of the "Direction of Sail"? • When will you engage the foils? • How many turns do you have? • THINK! Too many turns = slow, too few = out of bounds. • Would changing your sail times enable you to reach the start line on 0. • THINK! You might have to increase or decrease sailing time. CHALLENGE: How close to 0.0 seconds can you cross the start line?
PLENARY: How did you do? • The sequence we put the instructions in MATTERS! • There is more than one way to solve the problem, if it works, its right! • When coding for a real-world situation, the task may require a less efficient program to achieve the desired outcome.
Curriculum Links – Key Stage 2 • Pupil should be taught to: • Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts. • Use sequence, selection, and repetition in programs, work with variables and various forms of input and output. • Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs.
Curriculum Links – Key Stage 3 • Pupil should be taught to: • Design, use and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems • Understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem • Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures [for example, lists, tables or arrays]; design and develop modular programs that use procedures or functions