Teacher Boen Resource Library · Kenya CBC/CBE
Grade 9 · Pre-Technical Studies

2.2 Visual Programming

Strand 2 Communication in pre-technical studies

1. Meaning of Visual Programming

Visual programming is a method of creating computer programs using graphical elements such as blocks, symbols, and diagrams instead of relying mainly on written programming commands.

In block-based visual programming, users drag and connect instruction blocks to make a computer perform tasks.

2. Examples of Visual Programming Software

What Is Scratch Online at Adrienne Maldonado blog

Scratch

Used to create animations, stories, games, and interactive projects.

Designer and Blocks Editor

MIT App Inventor

Used to create mobile phone applications.

MakeCode visual options | micro:bit

Microsoft MakeCode

Used to teach coding and program supported devices.

Solved the Google Blockly maze!

Blockly

Provides blocks for constructing programming instructions.

3. Characteristics of Visual Programming Software

  1. Uses graphical blocks or symbols.
  2. Allows users to drag and connect commands.
  3. Makes programming easier for beginners.
  4. Reduces the need to memorize complicated commands.
  5. Supports creativity and problem-solving.
  6. Allows users to test and correct programs.
  7. Can be used to develop interactive applications.

4. Application Areas of Visual Programming

Application area

Examples

Education

Educational games and quizzes

Entertainment

Computer games and animations

Agriculture

Simple farm record applications

Business

Sales and stock calculators

Health

Health education applications

Transport

Transport fare calculators

Home management

Household budgeting applications

Environmental conservation

Waste sorting educational games

Communication

Interactive stories and information applications

5. Common Programming Blocks

A. Motion blocks: Make characters move, turn, or change position.

B. Looks blocks: Change the appearance of characters and display messages.

C. Sound blocks: Play music, sound effects, and recorded audio.

D. Event blocks: Start actions when an event occurs, such as clicking a button.

E. Control blocks: Manage repetition, waiting, and decisions.

F. Sensing blocks: Detect input from users or the environment.

G. Operator blocks: Perform calculations and comparisons.

H. Variable blocks: Store information such as scores, prices, and quantities.

6. Steps in Creating an Application Using Visual Programming

  1. Identify a problem to solve.
  2. Decide what the application should do.
  3. Select suitable visual programming software.
  4. Design the application's appearance.
  5. Choose the required programming blocks.
  6. Arrange the blocks in the correct order.
  7. Run the program.
  8. Test whether it solves the problem.
  9. Correct errors.
  10. Save and share the completed application.

7. Practical Example: Creating a Shopping Cost Calculator

Problem: A shopper needs to calculate the total cost of purchasing several items.

Software: Scratch or another suitable visual programming environment.

Required inputs:

  • Price of one item
  • Quantity purchased

Process:

Total cost = Price × Quantity

Example: If one exercise book costs KSh 50 and a learner buys 4 books:

Total cost = 50 × 4 = KSh 200

A simplified Scratch-style program:

When green flag clicked

Ask "Enter item price" and wait

Set price to answer

Ask "Enter quantity" and wait

Set quantity to answer

Set total to price × quantity

Say total

This is a simplified representation of the program logic. Actual block appearance varies across platforms.

8. Importance of Visual Programming in Daily Life

  1. Develops problem-solving skills.
  2. Encourages creativity.
  3. Promotes computational thinking.
  4. Makes programming accessible to beginners.
  5. Helps automate simple activities.
  6. Supports learning through games.
  7. Encourages innovation.
  8. Develops digital literacy.

Learning Activities

  1. Identify examples of visual programming software.
  2. Open Scratch and explore the available blocks.
  3. Create an animation of a moving character.
  4. Develop a simple multiplication calculator.
  5. Test and correct a program.
  6. Present an application that solves an everyday problem.

Revision Questions

  1. What is visual programming?
  2. Name four visual programming applications.
  3. State five characteristics of visual programming software.
  4. Explain four areas where visual programming is used.
  5. Describe the steps involved in creating a visual programming application.
  6. State five benefits of visual programming.