Introduction to QBASIC Programming
Course Description: This course is designed to introduce students to the QBASIC programming
language. Students will learn the syntax, basic programming structures, and techniques for
developing interactive programs. The course emphasizes problem-solving, logical thinking, and
developing a solid foundation for future programming endeavors.
Prerequisites: None, although a basic understanding of computers is helpful.
Course Duration: 10 weeks (3 hours per week)
Course Format:
Lectures
Hands-on coding exercises
Quizzes and assignments
Final project
Week 1: Introduction to QBASIC and Setup
Objectives:
Understand the history and relevance of QBASIC in the evolution of programming
languages
Set up the QBASIC development environment
Topics:
What is QBASIC? A brief history and overview
Installing QBASIC and setting up the IDE (Integrated Development Environment)
Introduction to the QBASIC interface and navigation
Writing and executing your first QBASIC program (PRINT "Hello, World!")
Assignment:
Write a simple QBASIC program that outputs "Hello, World!" to the screen.
Week 2: Variables and Data Types
Objectives:
Understand the role of variables and data types in programming
Learn to declare and use variables in QBASIC
Topics:
What are variables and constants?
Basic data types in QBASIC: Integer, Single, Double, String, Boolean
Declaring variables using DIM
Assigning values to variables
Type conversion and type mismatch errors
Assignment:
Create a QBASIC program that declares variables of different types and outputs their
values.
Week 3: Input and Output
Objectives:
Learn how to take user input and display output in QBASIC
Topics:
The INPUT statement: Taking input from the user
The PRINT statement: Displaying output to the screen
Formatting output using TAB, ;, and ,
Using the LINE INPUT statement for string input
Assignment:
Write a program that asks for the user's name and age and displays a personalized
message using the INPUT and PRINT statements.
Week 4: Operators and Expressions
Objectives:
Learn how to perform calculations and comparisons in QBASIC
Topics:
Arithmetic operators: +, -, *, /, MOD, ^
Relational operators: =, <, >, <=, >=, <>
Logical operators: AND, OR, NOT
Using expressions for more complex calculations
Assignment:
Write a program that calculates the area of a rectangle based on user input (length and
width).
Week 5: Control Structures - Conditionals
Objectives:
Learn how to make decisions in your program using conditional statements
Topics:
The IF...THEN statement
The IF...THEN...ELSE statement
The SELECT CASE statement
Nested conditionals
Logical operators in conditionals
Assignment:
Write a program that asks for a user's age and outputs whether they are a child, teenager,
or adult based on their age.
Week 6: Loops and Iteration
Objectives:
Understand how to repeat tasks using loops
Topics:
The FOR...NEXT loop: Iterating a specific number of times
The WHILE...WEND loop: Repeating until a condition is met
The DO...LOOP loop: Looping with more flexibility
The EXIT statement to break out of loops
Assignment:
Write a program that calculates the sum of all even numbers between 1 and 100 using a
FOR loop.
Week 7: Subroutines and Functions
Objectives:
Learn how to organize your code using subroutines and functions
Topics:
What are subroutines and functions?
Creating and calling subroutines with GOSUB and RETURN
Creating and calling functions with FUNCTION and END FUNCTION
Passing arguments to subroutines and functions
Assignment:
Create a program that uses a function to calculate the factorial of a number.
Week 8: Arrays and Collections
Objectives:
Understand how to work with arrays and collections of data in QBASIC
Topics:
What is an array? Declaring and using arrays in QBASIC
One-dimensional and multi-dimensional arrays
Array operations: accessing, updating, and deleting elements
Using arrays to store and manipulate large sets of data
Assignment:
Write a program that stores 10 student names in an array and displays them one by one.
Week 9: File Handling and Data Persistence
Objectives:
Learn how to read from and write to files in QBASIC
Topics:
Opening, reading, and writing text files using OPEN, INPUT, OUTPUT, and WRITE
Appending data to files
Closing files using CLOSE
Handling file errors and checking for file existence
Assignment:
Write a program that stores user input in a text file and allows the user to view the
contents of the file.
Week 10: Final Project and Review
Objectives:
Review all the concepts learned throughout the course
Apply the skills in a final programming project
Topics:
Overview of final project requirements
Recap of important QBASIC concepts: variables, loops, conditionals, file handling, and
functions
Preparing for the final project
Final Project:
Develop a QBASIC program that performs a meaningful task, such as a simple
calculator, inventory system, or text-based game. The project should incorporate
variables, loops, conditionals, and functions.
Assignment:
Submit the final project along with a brief explanation of how the program works and the
problem it solves.
Grading Breakdown:
Weekly Assignments: 50%
Final Project: 30%
Quizzes: 20%
Recommended Resources:
QBASIC Manual: "QBASIC: A Beginner's Guide" by Tom Swan
QBASIC IDEs: QB64 (modern QBASIC interpreter)
Online resources: QBASIC Programming forums and communities