# small basic

## 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

• Use the Text Window  to output and input data
• Use variables to store data and calculate a result based on user inout
• Debug Faulty Code

#### Lesson Structure

What's new in the world of Computer​s ( 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

#### 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

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 ")

' 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")
TextWindow.WriteLine(newname)

TextWindow.Title = "Let's take a quiz."
TextWindow.WriteLine("Name the third planet from the Sun: ")
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)

• Use of Subroutines  ( structured Programming
• Use of Loop statements  ( Iteration For While Loops )
• Use of Variables  (Temp Store of Data)
• Attractive Graphical User Interface
• Conditional Statements  ( IF Then Else )
• Score Counter

### 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)

##### 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)

## 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("Hello " + name)
TextWindow.WriteLine "What type of food do you like"

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