Download presentation
Presentation is loading. Please wait.
1
Lesson 3
2
By the end of Today’s lesson you will:
LO1: Recall what a variable is and how to use one in a Small Basic Program LO2: Be able to write and evaluate a program where the user has to enter data for the program to run. LO3: Be able to create variables with sensible names.
3
Whilst your teacher takes the register
On the sheet put the variable names and what the most suitable variable contents would be in the correct columns.
4
Starter Order the program.
The program uses the variable food to say what my favourite food is. Swap seats with the person next to you and check that they ordered it correctly Open Small Basic and write the program you have just corrected…..Did it work?
5
Answer to starter food= “pizza” TextWindow.WriteLine ( “My favourite food is” + food)
6
The Read() keyword TextWindow.WriteLine("What is your name? ") name = TextWindow.Read() TextWindow.WriteLine("Hello "+name) This is the name of the variable where the computer will store the users input This means that the computer is reading what the user types in and storing it in a variable called name It is an operation and basically it tells the computer to wait for the user to type in something and hit the ENTER key. Once the user hits the ENTER key, it takes what the user has typed and returns it to the program. The interesting point is that whatever the user had typed is now stored in a variable called name. A variable is defined as a place where you can store values temporarily and use them later. In the line above, name was used to store the name of the user
7
Activity: TextWindow.WriteLine("What is your name? ") usersname = TextWindow.Read() TextWindow.WriteLine("Hello "+usersname)
8
Peer Assessment Give it this face if it is almost there, can you tell your partner how to make it a full smile? If you gave your partner this face, say what is good about it and how to improve. Give it a full smiley face if it does exactly what it suppose to, can you write why you gave it this face?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.