Small basic lesson 2 (Mr Evlat)

1. In the code on the left why is the turtle sprite not moving?

2. In the code on the right what line of code has made the turtle sprite stop drawing?
1 / 14
next
Slide 1: Open question
ComputingLower Secondary (Key Stage 3)

This lesson contains 14 slides, with interactive quizzes and text slides.

time-iconLesson duration is: 50 min

Items in this lesson

1. In the code on the left why is the turtle sprite not moving?

2. In the code on the right what line of code has made the turtle sprite stop drawing?

Slide 1 - Open question

This item has no instructions

Do Now answer
1. There is no argument for distance in the brackets
2. Turtle.PenUp has been used which lifts the pen up to stop drawing as the turtle moves

Slide 2 - Slide

This item has no instructions

Lesson objectives 

Conquer: Understand the concept of variables
 
Aspire Higher: To apply variable knowledge to create a chat bot





 
 
Aspire: Create a set of loops to make a program more efficient.

Slide 3 - Slide

This item has no instructions

W
What is a Variable?
A variable is a named box in the computer’s memory where we can store a value so we can use it later.

  • Think of a variable like a labelled box.
  • The label is the name of the variable.
  • The item you put in the box is the value.
  • Our variable name should relate to the value stored inside. 
Age
13

Slide 4 - Slide

This item has no instructions

Hearts
Hunger
Wood
Name
8
5
22
Steve

Slide 5 - Slide

“In Small Basic, we create a variable by choosing a name, then using the equals symbol (=) to store a value inside it.”

Slide 6 - Slide

This item has no instructions

Type this code, instead of my name use your name
instead! What does this code do?
  • We have created a variable named "name" and assigned our value e.g "Mr Evlat". This is then printed onto the screen using TextWindow.WriteLine(name)
Small basic
Name
Mr Evlat

Slide 7 - Slide

This item has no instructions

What 2 things does a Variable Need?

Slide 8 - Open question

This item has no instructions

Inputs
An input is information that the user gives to the computer, which the program can then use later in the program.  Test out this code to see what it does.
  • The variable "name" is assigned whatever value the user (you) enters using the line TextWindow.Read() . This is then printed on the screen with the message "Hello + (whatever name you entered)"
name
(User input)

Slide 9 - Slide

This item has no instructions

A

Slide 10 - Slide

This item has no instructions

In your partners or groups use this code to program your own chatbot. Create the following questions and print the responses! Only Partner A should write the code, Partner B should tell them what to write

  1. Ask your age
  2. Ask your favourite food
  3. Ask your favourite Show/film
Small basic
Glossary

Slide 11 - Slide

TextWindow.WriteLine("What is your name?")
name = TextWindow.Read()
TextWindow.WriteLine("Hello " + name)
What is the purpose of this line of code?

TextWindow.WriteLine(text)
A
Writes text to screen
B
Stores information
C
Changes the colour of the pen
D
To change the value stored in the variable "text"

Slide 12 - Quiz

This item has no instructions

What is the purpose of this line of code?

TextWindow.Read()
A
Saves information
B
Writes text to screen
C
Allows the user to input information
D
Moves the turtle

Slide 13 - Quiz

This item has no instructions

A variable is a ________ box in the computer’s __________ where we can store a ______ so we can use it later.
named
memory
value

Slide 14 - Drag question

This item has no instructions