QBasic is a simple to use and learn computer language. QBasic is free and works on most computers. This tutorial will get you started programming in QBasic.
In Lesson 1, we saw that PRINT was capable of printing text surrounded by quotes. PRINT is capable of doing a bit more. PRINT is capable of printing calculations too.
Within this tutorial, print formatting will be used to show the user what calculations are being used.
The computer can hold data in memory. The programmer must tell the computer what type of data to hold. This is called a data type.
It is very important that the data matches the data type of the variable. If the data does not match the data type then a type mismatch occurs.
This tutorial will cover getting user input.
If statements are used to check conditions in the program.
Select-Case statements work like If statements. The difference is that the Select-Case statement can make the code simpler to read and work with than If statements.
This tutorial will show the While loop.
This tutorial will show the While Loop.
This tutorial will show the For loop.
This tutorial will show how to make a simple calculator program that asks the user for two numbers.
This tutorial shows several pitfalls in making random numbers. It is a good idea to practice making random numbers and random number generators on your own.
We will make the classic game Guess My Number. It is a very boring game to play, by today’s standards, but programing the game can be interesting.
Arrays hold lists of variables of the same data type.
Parallel Arrays are separate arrays that work together.
Multi-Dimensional Arrays are several arrays that are combined into one. Some examples where a 2 dimensional array might be used would be a chess board, grid, and a deck of cards.
This tutorial will modify the code made within Tutorial 17. This tutorial will show a different way of loading data into an array. By using READ and DATA, the code can be more compact and easier to read.
This tutorial will show how to find the highest and lowest number within an array.
Unfortunately, QBasic1.1, QuickBasic 4.5 and QB64 do not have built in Boolean data types. However, here is three techniques showing how to use Boolean logic within QBasic.
By checking the contents of the array, we can prevent duplicate data from entering into the array.
This tutorial will show how to manipulate strings. The program will print strings vertically, upside down vertically, and in pieces.
This tutorial will show how find if a word or string is a palindrome. A palindrome is a word or string that is the same printed forwards and backward.
Sometimes we need to separate parts of the string. This program will checks each character in the string and separates the characters into letters, numbers and other characters.
There are a few ways of making sounds and music in QBasic. This tutorial will show you how to make songs.
Screen 13 will be used within this tutorial. Screen 13 has a resolution of 320 x 200
There are several screen that are used within QBasic 1.1. QB64 can make custom screens.
This is the introduction to QBasic drawing. SCREEN 13 is used within this tutorial. Line, Box, Box Fill, Paint and Circle will be shown.
SCREEN 13 is used with in this tutorial. This tutorial is a continuation of Drawing Part 1
This is a continuation of Drawing Part 2
This tutorial focuses on drawing with QB64.
This tutorial focuses on drawing with QB64.
This tutorial will show how to move an object (drawn circle) around the screen using keyboard keys.
This tutorial will modify the code used within Tutorial 33.
To use the arrow keys, we need to know the PC Keyboard Scan Codes for keyboard arrow keys.
As programs become more advanced placing all the code in the main program can make the program more difficult to program, maintain, and understand. Slicing the program into sections can help.
This tutorial will show how to make a sub in QB64.
When we made subs in the previous tutorials, we needed to use SHARED when using the same variable within a sub. If we do not wish to make shared variables we can pass the values to the sub.
Functions are very similar to subs with exception that functions return values back to the part of the program that called the function.
Up to this point, all information, used by the programs could not be saved. When the program was closed all information was lost. To keep information saved, in QBasic, text files must be used.
Continuing from Part 1, the next program shows what happens if a file, that does not exist, is opened for input.
Continuing from Part 2, this program will open a text file, that contains questions and quiz the student.
Please Show Your Appreciation For Our Hard Work
Tutorial 4 - Variables And Data Types
Tutorial 5 - Type Mismatch And Other Data Type Errors
Tutorial 8 - Select Case Statements
Tutorial 12 - Simple Calculator Input Validation
Tutorial 14 - Guess My Number Game
Tutorial 17 - 2D Array - Matrix
Tutorial 18 - Matrix Read Data
Tutorial 19 - Highest And Lowest Array Element
Tutorial 20 - Boolean Techniques
Tutorial 21 - Preventing Duplicate Data In The Same Array
Tutorial 22 - String Manipulation
Tutorial 23 - Palindrome Program
Tutorial 24 - ASCII Program - Separating Letters, Numbers, And Other Characters
Tutorial 26 - Screen Coordinates
Tutorial 32 - QB64 Drawing Part 2
Tutorial 33 - Moving An Object With The Keyboard
Tutorial 34 - Moving An Object With Arrow Keys
Tutorial 35 - Making A Sub In QBasic 1.1
Tutorial 36 - Making A Sub In QB64
Tutorial 37 - Passing Values To Subs
Tutorial 38 - Making A Function
Tutorial 39 - Text Files Part 1
Tutorial 40 - Text Files Part 2 - Checking If The File Exists
Tutorial 41 - Text Files Part 3 - QBasic Quiz Questions Program- QB64