×
13 Lessons

Model 2

In this module, we continue our journey into programming by introducing one of the earliest and most widely used beginner-friendly programming languages: QBasic. This curriculum is designed to help participants understand the fundamental principles of programming using QBasic as a foundation. By the end of this module, you will be able to write, run, and debug simple programs while also learning the logical thinking skills necessary to advance into modern programming languages.

19 Lessons

This is Lesson 17 of the Principles of Programming course. In this lesson, students are introduced to the concept of loops in programming and QBASIC.

Students learn that loops are programming statements used to repeat a block of code multiple times until a specific condition is met or a set number of repetitions is completed.

The lesson explains the importance of loops in programming, including how they help programmers save time, reduce code size, and handle repetitive tasks efficiently.

The lesson also includes a practical QBASIC example using the WHILE...WEND loop. Students follow the program step by step to understand how a variable is initialized, how the loop condition is checked, how calculations are displayed, and how the variable is increased during each repetition.

Topics Covered:

• Introduction to loops in programming
• What loops are in QBASIC
• Why loops are used
• Saving time with loops
• Reducing code size
• Handling repetition
• WHILE...WEND loop
• Loop conditions
• Variables in loops
• Incrementing a variable
• Practical QBASIC programming
• Understanding program output

Practical Exercise:

Students work with a QBASIC program that starts a variable at 1 and uses a WHILE...WEND loop to display multiplication results. The practical exercise demonstrates how the loop continues while the condition remains true and how the variable changes after each repetition.

Learning Outcomes:

By the end of this lesson, students should be able to:

• Explain what a loop is in programming.
• State reasons why loops are used.
• Explain how loops reduce repetitive programming statements.
• Identify the condition controlling a loop.
• Use a variable within a loop.
• Increase a variable during each repetition.
• Understand the output produced by a simple QBASIC loop.