You can do Practical 1 by following the book or by listening to the instructions.
In this practical, we are going to solve a problem that we face at the start of every year: introducing ourselves to our classmates and teachers. This time, we can do it in an original way using a computer and one or more of the algorithms we have studied.
Exercise 1. Analysis
We are going to do our introduction using a sprite and a backdrop from Scratch. The sprite will be the Starfish from the Animals category and the backdrop will be beach malibu. You can find these in the sprites and backdrops libraries, respectively.
First of all, think of four aspects to define the sprite: name and age, favourite colour, likes and hobbies, favourite music, etc. We have called our sprite Balubita. She is 150 years old, her favourite colour is blue and her favourite music is hip hop.
Exercise 2. Design
Now we need to design our introduction. Should we develop the project sequentially? Will we need to repeat an instruction? Will a condition need to be met to activate any movement, music or sound effects? Will the character move?
When she introduces herself, Balubita will tell us her name, age and favourite colour sequentially. She wants to turn blue when she tells us what colour she is and she wants to move along the beach. Balubita will then ask us to click on her to play her favourite music.
Exercise 3. Flowchart
The flowchart in the margin indicates the order of the instructions. It is an algorithm that combines sequential and iterative structures.
Exercise 4. Programming in Scratch
Now code the presentation in Scratch programming language following the flowchart.
- Go to http://scratch.mit.edu and click on Create. Start a new project by going to File / New and name it Unit01_P1_A_namesurname.
- Select the correct sprite and backdrop.
- Start coding with the instruction when green flag clicked and include the instructions one by one.
- Use the say ... for instruction from the Looks category to add each message and choose a duration of 2 seconds for each.
- To change the colour of the sprite, add the instruction set color effect to ... and type 150 to turn it blue.
- Then nest the instruction glide 1 secs to x: 150 and: -50, from the Motion category.
- In a separate program, include the instruction when this sprite clicked from the Events category.
- After this instruction, nest the order play sound ..., from the Sound category and select hip hop (you will find this sound in the Scratch sound library). This will give you two programs that look like the ones on the right: