22 May Lesson 2 Variables and Arrays
Make Copy Of lesson and Activities Click Here and make a copy
Create new Google page Small Basic Week 2 and upload screen shots of your program that creates the area and circumference of a circle given its diameter
Lesson Structure
What's new in the world of Computers ( latest news what is happening of interest ) would normally be a video followed by brief class discussion
Review of previous lesson to determine any misconceptions. Introduction to tasks and lesson objectives. Modeling or provision of a screencast
Independent Learning Students work on any tasks/activities given to acquire new skills
Project based learning: Students work ( or work on project ) ideally cross curriculum ( student-centered, and include the teacher in the role of facilitator )
10mins
10mins
30mins
40mins
Read more on Project based learning
Today's Lesson Objectives
Marking will be based on participation during class time
Small Basic Guide
Easy and Fun Code Examples Copy and paste into Small Basic Editor
' Flicker Images
GraphicsWindow.Height = 400
GraphicsWindow.Width = 400
GraphicsWindow.BackgroundColor = "pink"
'
For i = 1 To 15
pic = Flickr.GetPictureOfMoment()
GraphicsWindow.DrawResizedImage(pic,0,0,400,400)
Program.Delay(100)
EndFor
'Follow the Mouse
GraphicsWindow.BrushColor = "Blue"
GraphicsWindow.MouseDown = OnMouseDown
Sub OnMouseDown
x = GraphicsWindow.MouseX - 10
y = GraphicsWindow.MouseY - 10
GraphicsWindow.FillEllipse(x, y, 20, 20)
EndSub
'if else statement
TextWindow.WriteLine ( "choose shape to draw by typing in circle or rectangle ")
shapeneeded = TextWindow.Read()
' if user entered circle enterd draw circle
If shapeneeded ="circle" Then
GraphicsWindow.DrawEllipse(100,10,100,100)
'if user entered rectangle draw rectangle
Else
GraphicsWindow.DrawRectangle(100,10,100,100)
EndIf
TextWindow.Show()
TextWindow.WriteLine("name")
newname =TextWindow.Read()
TextWindow.WriteLine(newname)
'Simple Example of Question Answer
TextWindow.Title = "Let's take a quiz."
TextWindow.WriteLine("Name the third planet from the Sun: ")
answer = TextWindow.Read()
If (Text.StartsWith(answer, "Earth") Or Text.StartsWith(answer, "earth")) Then
Sound.PlayChime()
TextWindow.WriteLine("You are absolutely right!")
Else
TextWindow.WriteLine("That is incorrect.")
Sound.PlayBellRing()
EndIf
Project Completion Date Week Starting 4th June ( Presentations of student work)
Create a Quiz in Small Basic - Questions Answers Linked to another subject of study ( Biology, Chemistry or Maths for example)
Rubric
Program | Excellent | Good | Fair | Poor |
---|---|---|---|---|
Program execution | Program executes correctly with no syntax or run time errors (9-10) | Program executes with a minor (easily fixed error) (2-3) | Enter your text here... | |
Expected output | Program displays correct output with no errors (9-10) | Output has minor errors (6-8) | Output has multiple errors (3- 5) | Output is incorrect (0-2) |
GUI ( screen design) | Program displays more than expected (9-10) | Program displays minimally expected output (6-8) | Program does not display the required output (3- 5) | Output is poorly designed (0-2) |
Design Logic | Program is logically well designed (9-10) | Program has slight logic errors that do no significantly affect the results (6-8) | Program has significant logic errors (3-5) | Program is incorrect (0-2) |
Standards | Program is stylistically well designed (5) | Few inappropriate design choices (i.e. poor variable names, improper indentation) (4) | Several inappropriate design choices (i.e. poor variable names, improper indentation) (2-3) | Program is poorly written (0-1) |
Documentation | Program is well documented (5) | Missing one required comment (4) | Missing two or more required comments (2-3) | no program comments |
22 May Find and Correct Syntax and Logical Bugs
Instructions: Work in teams of 2 to find to get the 2 programs below running by fixing any syntax errors
' work in teams of 2 to fix any syntax errors and get the programs to run
TextWindow.Show()
TextWindow.WriteLine("What is your name?")
name = TextWindow.Read()
TextWindow.WriteLine("Hello " + name)
TextWindow.WriteLine "What type of food do you like"
favfood = TextWindow.Read()
TextWindow.WriteLine("Hi " + name + "I also like " . favfood)
' work in teams of 2 to find the logical bug and fix it
TextWindow.Show()
For i =1 To 10
TextWindow.WriteLine("enter a number please")
newnumber = TextWindow.Read()
If (newnumber < 5) Then
TextWindow.WriteLine("number is less than 5")
Elseif (newnumber >= 5) Then
textWindow.WriteLine("number is greater than 5")
else
textWindow.WriteLine("number is 5")
EndIf
EndFor