KEMBAR78
Scratch Programs | PDF | Scratch (Programming Language) | Computer Science
0% found this document useful (0 votes)
14 views10 pages

Scratch Programs

The document provides step-by-step instructions for creating various Scratch programs that involve user interaction, such as asking for a name, age, favorite game, and performing mathematical operations. Each program includes details on setting up sprites, backdrops, and using specific Scratch blocks to achieve the desired functionality. The document emphasizes saving and running the projects after completion.

Uploaded by

daniakhalid600
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Scratch Programs

The document provides step-by-step instructions for creating various Scratch programs that involve user interaction, such as asking for a name, age, favorite game, and performing mathematical operations. Each program includes details on setting up sprites, backdrops, and using specific Scratch blocks to achieve the desired functionality. The document emphasizes saving and running the projects after completion.

Uploaded by

daniakhalid600
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Write a program in scratch where sprite asks your name.

Run and save program.

Steps to Build the Program

Follow these steps inside the Scratch editor:

1. Start a New Project


o Open scratch.mit.edu and create a new project.
2. Add Code to the Sprite Click on the default sprite (usually a cat) and use these blocks
from the Events, Sensing, and Looks categories:

scratch

when green flag clicked


ask [What is your name?] and wait
say (join [Hello, ] (answer)) for 2 seconds

o The ask block comes from Sensing.


o The answer block automatically stores what the user types.
o join combines the greeting with the user’s input.

3. Optional: Customize the Sprite


o You can change its costume or add animations for extra flair.
4. Run the Program
o Click the green flag to test it.
5. Save Your Project
o Click File > Save now to keep it safe.
Write a program in scratch where sprite asks your age. Run
and save the program.

Steps to Build the Program

Follow these steps inside the Scratch editor:

1. Start a New Project


o Open scratch.mit.edu and create a new project.
2. Add Code to the Sprite Click on the default sprite (usually a cat) and use these blocks
from the Events, Sensing, and Looks categories:

scratch

when green flag clicked


ask [What is your name?] and wait
say (join [Hello, ] (answer)) for 2 seconds

o The ask block comes from Sensing.


o The answer block automatically stores what the user types.
o join combines the greeting with the user’s input.

3. Optional: Customize the Sprite


o You can change its costume or add animations for extra flair.
4. Run the Program
o Click the green flag to test it.
5. Save Your Project
o Click File > Save now to keep it safe.
Write a program in scratch where sprite asks your age. run
and save the program
Steps to Build the Program

Follow these steps in the Scratch editor:

1. Start a New Project


o Go to scratch.mit.edu, click “Create” to start a new project.
2. Add Code to the Sprite Use blocks from the Events, Sensing, and Looks categories.
Here's what to use:

scratch

when green flag clicked


ask [How old are you?] and wait
say (join [You are ] (join (answer) [ years old!])) for 2
seconds

o ask [...] and wait: prompts the user for input


o answer: stores what the user types
o join: combines strings so it can say the full sentence

3. Test the Program


o Press the green flag button. The sprite will ask your age and respond.
4. Save Your Work
o Click File > Save now
Write a program in scratch that asks your name and says
your name. Run and save
Steps to Build the Program

 Open scratch.mit.edu and click “Create.”

 Use These Blocks on the Sprite

From the Events, Sensing, and Looks categories, add:

scratch

when green flag clicked


ask [What's your name?] and wait
say (join [Nice to meet you, ] (answer)) for 2 seconds

 ask [...] and wait: prompts the user


 answer: stores the user’s input
 join: combines strings to make a full sentence
 say [...]: displays the sprite’s speech

 Test the Program

 Hit the green flag and type in your name when prompted.

 Save the Project

 Click File > Save now


Write a program in scratch that asks your name and reply
hello. Save and run
Steps to Build the Program

 Start a New Project

 Go to scratch.mit.edu and click Create to start fresh.

 Add Code to the Sprite Use blocks from Events, Sensing, and Looks:

scratch
when green flag clicked
ask [What's your name?] and wait
say (join [Hello, ] (answer)) for 2 seconds

 ask [...] and wait: prompts for the user’s name


 answer: stores the typed response
 join: glues the greeting and the name together
 say [...]: lets the sprite speak

 Run the Program

 Click the green flag in the Scratch interface to test it.


 Type your name when prompted—the sprite will reply with a personalized “Hello!”

 Save Your Project

 Click File > Save now


Make a program in scratch with a new sprite and backdrop.
Program asks for your favorite computer game and says " i
like to play" and name of game. Save and run.
Steps to Build the Program
1. Start a New Project

 Go to scratch.mit.edu and click Create.

2. Choose a New Sprite

 Delete the default cat sprite (optional).


 Click the Choose a Sprite button and select any sprite that fits your theme (a gaming
character, alien, robot—whatever feels fun!).

3. Set a New Backdrop

 Click the Choose a Backdrop button.


 Pick something playful like “Bedroom,” “Galaxy,” or “Arcade.”

4. Add the Code to the Sprite

Use blocks from Events, Sensing, and Looks:

scratch
when green flag clicked
ask [What's your favorite computer game?] and wait
say (join [I like to play ] (answer)) for 3 seconds

🧩 Block explanation:

 ask [...] and wait: gets user input


 answer: stores it
 join: combines “I like to play” + the user's reply
 say [...]: makes the sprite say it

5. Save the Program

 Click File > Save now



Make a program in scratch that asks for a number and then
tells you that number plus five. Save and run.
Steps to Build the Program
Start a New Project

 Go to scratch.mit.edu and click Create.

2. Choose a New Sprite

 Delete the default cat sprite (optional).


 Click the Choose a Sprite button and select any sprite that fits your theme (a gaming
character, alien, robot—whatever feels fun!).

3. Set a New Backdrop

 Click the Choose a Backdrop button.


 Pick something playful like “Bedroom,” “Galaxy,” or “Arcade.”

4. Add the Code to the Sprite

Use blocks from Events, Sensing, and Looks:

scratch
when green flag clicked
ask [What's your favorite computer game?] and wait
say (join [I like to play ] (answer)) for 3 seconds

🧩 Block explanation:

 ask [...] and wait: gets user input


 answer: stores it
 join: combines “I like to play” + the user's reply
 say [...]: makes the sprite say it

5. Save the Program

 Click File > Save now



Make a scratch program that multiplies a number by seven.
and make another program that uses another maths
operator.
Steps to Build the Program

1. Create Variables
o number
o result
2. Use These Blocks:

scratch
when green flag clicked
ask [Enter a number:] and wait
set [number] to (answer)
set [result] to ((number) * (7))
say (join [That number times 7 is ] (result)) for 2 seconds

🧠 Program 2: Subtract 10 from a Number

Steps to Build the Program

Create Variables

o number
o difference

2. Use These Blocks:

scratch
when green flag clicked
ask [Give me a number:] and wait
set [number] to (answer)
set [difference] to ((number) - (10))
say (join [Your number minus 10 is ] (difference)) for 2 seconds
Make a scratch program with forever loop. It inputs number
and then outputs that number times two. Make a program to
match your plan. Save and run
Steps to Build the Program

 Go to scratch.mit.edu and click Create.

2. Create Variables

 Go to Variables and make:


o number
o result

3. Use These Blocks

From Events, Control, Sensing, Operators, and Looks, use this combo:

scratch
when green flag clicked
forever
ask [Enter a number:] and wait
set [number] to (answer)
set [result] to ((number) * (2))
say (join [Your number times 2 is ] (result)) for 2 seconds
end

 forever: keeps the interaction going endlessly


 ask [...] and wait: takes input
 set variable: stores input and calculation
 say [...]: shows result

💾 Save Your Project

 Click File > Save now


Write a scratch program with forever loop. The user enters
a series of numbers. Each time the program outputs the
number 10 times and then the number times 11. Make a
program to match your plan. Save and run
Steps to Build the Program
1. Create Your Project

 Go to scratch.mit.edu
 Click Create for a new blank project

2. Create Variables

 number
 timesTen
 timesEleven

3. Add This Code to the Sprite


scratch
when green flag clicked
forever
ask [Enter a number:] and wait
set [number] to (answer)
set [timesTen] to ((number) * (10))
set [timesEleven] to ((number) * (11))
say (join [Number × 10 = ] (timesTen)) for 2 seconds
say (join [Number × 11 = ] (timesEleven)) for 2 seconds
end

Block :

 ask [...]: prompts user for input


 set variable: saves input and results
 *: performs multiplication
 say [...]: shows each result one at a time
 forever: keeps the loop going until you stop the program

4. Save and Share

 Click File > Save now

You might also like