Simple Qbasic Programs; Quick Basic programs for Beginners. - Webbertips

Breaking


Responsive Ads Here

Post Top Ad

Responsive Ads Here

Tuesday, October 6, 2020

Simple Qbasic Programs; Quick Basic programs for Beginners.

QBasic is an integrated development environment and interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled to an intermediate representation, and this IR is immediately interpreted on demand within the IDE-(Wikipedia).


Simple Qbasic programs


Qbasic in full QuickBASIC is a programming language used mostly to teach students how to program; it serves somewhat as a baseline to enlighten the students on some precepts of programming.

Qbasic has little or no use in this Era,but was used back in the day to make video games and also make some simple programs like calculators.


You can download Qbasic programs to your system windows 7 and 10 however here

You can also download Qbasic simulator; which works on Mobile and runs program accurately here.

Here are some simple programs you should try:

  • How to add 2 or more numbers in Qbasic.

     

  1. Rem Adding 2numbers in Qbasic
  2. input "Enter numbers here";a,b 
  3. let G=a+b 
  4. print "Result=";G 
  5. End 
  6.  

Or 
Maybe you want to add more numbers. 

     

  1. Rem program to Add numbers. 
  2. sum=0 
  3. input "Enter numbers here";a 
  4. sum=sum+a 
  5. Print sum
  6. Goto 3 
  7. End 
  8.  

Or 

     

  1. Rem program to add numbers.
  2. input "how many numbers do you want to add";a 
  3. sum=0
  4. For I=1 to a 
  5. input "Enter the numbers to add";b 
  6. sum=sum+b 
  7. Next I 
  8. Print "Total=";sum
  9. End 
  10.  

This processes can also be taken if you want to subtract numbers. Just incase you're not conversant with the basics of Qbasics I.e the terminologies; use the link below.

See also...

  • How to Make inputs with letters (Qbasic programs with letters)

     

  1. Rem program to accept names of pupils and ages.
  2. Input "What your name";a$ 
  3. Print a$ " Nice name" 
  4. Input "whats your age";b 
  5. Print a$ " is",b " years old"
  6. End
  7.  

On there,you'd notice I added a string to the one that would contain letters and then no string to the one that is meant to accept numbers (age). Its important to have those strings otherwise you won't be able to input letters.

There are cases where you could be asked to make a program in school which can choose between two things or pick alternatives or programs that contains decision makings. 

Heres an example: e.g Make a program to Accept students above the age of 13 and revoke or reject ages below 13.

     

  1. Rem program to accept names and ages 
  2. Input "What's your name";a$ 
  3. Input "What's your age";b 
  4. If b<=12 then print "Sorry,you're under aged" else print "Successful" 
  5. End
  6.  

There are basically other programs to try out e.g calculating a mean or even the area of a cycle and much more.

  • How to create a multiplication table using Qbasic.

     

  1. Rem program to make a multiplication table.
  2. Input "Number for multiplication table";a 
  3. For I=1 to 12 
  4. Let N=a*I 
  5. Print N 
  6. Next I 
  7. Goto 2
The program above is done using loops and would run none stop except you decide to stop it; you could alternatively use simple tags to run that same program. 

More programs you don't have clue about? Comment them below and we'll try our best to run them for you. Hope this piece was helpful.

PS: This page would be updated so check back for more programs.

No comments:

Post a Comment


Responsive Ads Here