Professional Documents
Culture Documents
Grade-8-4 Lesson
Grade-8-4 Lesson
Grade-8-4 Lesson
Every time we make a decision. After making this decision, over act on it.Thus,
decision-making is a two-step process.
1. Deciding what to do
2. Taking an Action
1. ………………………………………………………………………………….
2. ………………………………………………………………………………….
3. ………………………………………………………………………………….
For example,
let us consider an invoice issued by a ABC Bookshop. To calculate the price
(amount) of each item, number of items and unit price are required.
Input -
Process -
Output -
Example 1
……………………………………………………………………
……………………………………………………………………
……………………………………………………………………
……………………………………………………………………
……………………………………………………………………
…………………………………………………………………….
…………………………………………………………………….
…………………………………………………………………..
…………………………………………………………………..
…………………………………………………………………...
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
1.
2.
3.
Example -
Example -
Before marks are awarded, it must be checked whether the answer is correct or
wrong. If the answer is correct, 10 marks are awarded. Incorrect answers are
awarded no marks.
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………….
……………………………………………
….
…………………………………………….
Scratch components
➢ We can sprites (cat image) move 10 steps forward using Move –Steps in the Blocks
Palette and dragging it onto the Scripts Area.
➢ Turn …. Degrees
• Sprites
➢ Control Tools
• When. Clicked
- When the green flag is clicked do the following steps
• Wait..secs - It does nothing for 1 second. Go to the next step after 1 second
➢ Practical Example
Variable
➢ What is a variable?
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
…………………………………………………………………………………………
- There are two buttons displays in the block Blocks Palette. When clicked on the
variable block, the following image will be shown
• When clicked Make a variable in the Blocks Palette the following dialog box will be
displayed.
- For all sprites: Create a new variable that all sprites can see (Such as Marks)
- For this sprite only: Creates a new variable that only this sprite can see
➢ What is a errors?
…………………………………………………………………...................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
Type of Errors
• Syntax Error
• Semantic error
• Logical error
• Syntax errors:
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
• Semantic errors:
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
• Logical errors:
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
Two types of selection control structures can be used in developing Scratch programs
1. ………………………………………………………
2. ………………………………………………………
Ex -
…………………………………………………………………...................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
…………………………………………………………………...................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.......................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
1. Check whether the value on the left is smaller than the value of the right.
3. Check whether the value on the left is greater than the one on the right.
1. AND
2. OR
3. NOT