In this activity, we will build a grade calculator in PictoBlox. The program will ask the user for their score, then use logical operators and conditional statements to determine and display their grade.
Grading Criteria
Setting Up
- Open PictoBlox and create a New File.
- Select Block Coding as the coding environment.
- Choose any sprite — we will use Tobi for this activity.
- Create a variable called Score.
Building the Script
We will use nested If () Then Else blocks combined with AND operators to check the score range. You will find the blocks in the mentioned palettes:
- When flag clicked — Events
- Ask (Enter your score:) and wait — Sensing
- Set (Score) to (answer) — Variables
- If (Score ≥ 90) Then: Say (Grade: A) for 3 seconds — Control, Operators, Looks
- Else If (Score ≥ 80 AND Score < 90) Then: Say (Grade: B) for 3 seconds
- Else If (Score ≥ 70 AND Score < 80) Then: Say (Grade: C) for 3 seconds
- Else If (Score ≥ 60 AND Score < 70) Then: Say (Grade: D) for 3 seconds
- Else: Say (Grade: F) for 3 seconds

Running the Script
- Click the green flag to start the program.
- Enter a score when prompted and press Enter.
- Watch Tobi display the corresponding grade!

Save your file with the name Grade Calculator before moving on to the assignment!

.webp&w=3840&q=75)
.webp&w=3840&q=75)
.webp&w=3840&q=75)
.webp&w=3840&q=75)
.webp&w=3840&q=75)