SlideShare a Scribd company logo
Hello! & Namaste
I am Roshan Maharjan
I am here because I love to give
presentations.
You can find me at
@https://slideshare.net/RoshanMaharjan13
@fsscomputer2020@gmail.com
1
Basics of QBASIC
By: Roshan Maharjan
OUTLINES
➢ Identify the special features of QBASIC.
➢ Explain the elements of QBASIC programming.
➢ Identify the various methods of declaring
variables.
➢ Explain the importance of QBASIC syntax.
3
“Our greatest weakness lies in giving up.
The most certain way to succeed is
always to try just one more time.” –
Thomas A. Edison
4
QBASIC
Quick Beginner’s All-Purpose
Symbolic Instruction Code
1
5
Introduction
▪ QBasic is a simple programming language developed by
Microsoft to type, edit, debug and execute BASIC programs.
▪ A QBasic program consists of various elements. They are
a character set, constants, variables, statements, operators
and expressions.
▪ A QBasic statement is a command or set of instructions to
perform a certain task.
▪ BASIC is an interpreter which means it reads every line,
translate it and lets the computer execute it before reading
another.
▪ Each instruction starts with a line number.
6
Features
▪ It is simple and easy to learn.
▪ It is an interpreter having its own editor.
▪ It has dynamic program debugging
▪ It supports the local and global variable.
▪ It supports modular programming.
▪ It capitalizes the reserved words automatically.
▪ The syntaxes of the statements are checked automatically
7
Starting
with
QBASIC
8
This is the Program Area
Immediate Window
Starting QBASIC
▪ QBASIC may not be on your computer.
▪ At first, you need to have QBASIC in your computer.
▪ It is freely available. You can download it from the
Internet as well..
QBASIC Interface
9
Components of Qbasic
Menu Bar
It Consists of a
list of menus
like file, edit,
view, search,
Run, options
and help.
Program Window
The upper window
tittles “untitled” is
the window where
you write the
complete program.
F5 key is pressed to
execute or run the
program to get the
result.
Immediate Window
The lower window is
titled immediate
window where the
simple statements are
typed which get
executed immediately.
Errors are displayed
here.
10
Status Bar
It shows
shortcut keys
and location
of the cursor
on the screen.
File Menu Options
11
File Menu
New Clears the current program.
Open Loads a program from the desk.
Save Saves the current program to disk.
Save As
Saves the program, but under a different
name.
Print
Prints the selected text, current window,
or entire program.
Exit Closes the QBASIC interpreter.
Edit Menu Options
12
Edit Menu
Cut
Removes the selected text and stores it in the
clipboard.
Copy
Copies the selected text instead of removing
it.
Paste
Adds the text in the clipboard to the current
position of the cursor.
Clear
Removes the text without storing it on the
clipboard.
New Sub Enables you to create a new subroutine
New Function Enables you to create a new function
View Menu Options
13
View Menu
SUBs
Shows the list of current subroutines and
functions.
Split
Displays the contents of the current program
in two windows. If the window is already split,
this hides the second window.
Output
Screen
Shows the Qbasic output screen
Search Menu Options
14
Search Menu
Find
Allow you to search for a string of text in
the program
Repeat Last
Find
Continues the previous search operation
Change
Replaces each instance of a string with
another string
Run Menu Options
15
Run Menu
Start
Allow you to search for a string of text in the
program
Restart Continues the previous search operation
Continue
Replaces each instance of a string with
another string
Debug Menu Options
16
Debug Menu
Step Processes the next command
Procedure
Step
Processes the next command, does not show
Qbasic going inside a subroutine or function.
Trace On
Shows the command that is being executed
while the program is running.
Toggle
Breakpoint
Sets or removes a breakpoint.
Set Next
Statement
Allows you to continue execution at the
special line
Help Menu Options
17
Help Menu
Index
To display the help index by listing all the
commands, keywords, operators, etc
Contents To display the help table of content
Topic
To display information on a topic determined
by the current location of the cursor.
Using Help Displays information on using QBASIC help.
About
Shows information about the QBASIC
interpreter
▪ Character Sets
▪ Keywords
▪ Variable
▪ Constants
▪ Operators, expressions and operand
▪ Program statements
18
Elements of QBASIC
Character set is a set of valid characters that a language can
recognize.
A character represents any letter, digit, or any other sign.
The QBASIC has the following character sets:
▪ Alphabets A, B.. Z, a, b, c,.....z.
▪ Number 0-9.
▪ Special symbols like ;,=, +,-,/,*,( ),%, $, #, &, ?,<, >etc.
Character Set
19
▪ Keywords are the words that convey a special
meaning to the language.
▪ These are reserved for special purpose and must not
be used as normal identifier names.
▪ Some of the QBASIC keywords are: REM, CLS, INPUT,
LET, PRINT and END
Keywords
(Reserved Words)
20
🔑
Variable
21
▪ Variables are the memory locations in the computer’s
memory for storing data.
▪ They provide an “interface” to RAM.
▪ They are the containers that holds the information.
▪ Their sole purpose is to label and store the data in
memory so that can be used throughout the program.
The variable names have the following properties:
22
Continue……
Variable - Naming Conventions
▪ Any Variable name may be up to 40 characters long.
▪ Variable names must begin with a letter ( A…Z, a…z ).
▪ Cannot contain characters other than letters, numbers, period, and the type declaration
characters ($, %, #, &, and ! ).
▪ Cannot be a reserved words, although embedded reserved words are allowed.
▪ Variable may represent either numeric values or string.
▪ Cannot begin with “FN” unless it is a function call.
Variables occur in two distinct types i.e. numeric variable and string variable depending
upon data item they represent.
23
Continue……
Types of variables
▪ Numeric Variable
• Numeric variables store numeric data.
• It’s name can be formed by letters and digits.
• It should however always begin with an alphabet and should not contain any
special characters or spaces.
• For example, (i) age = 30 (ii) mark1 = 73.6. Here age is a numeric variable which
stores the constant value 30.
• Numeric variables may be declared as:
24
Continue……
Numeric Variable
▪ Integers
• Integer variable is declared by using a percent sign (%) as the last character of the
variable name
• They are stored as 2 bytes ranging in value from -32768 to +32767.
• The declaration of a variable as an integer causes the variable’s value to be rounded
to the closest integer.
• For example: A% = 50
• They accept only non-decimal values i.e real values
25
Continue……
Numeric Variable
▪ Long Integers
• Long Integer variable is declared by using a ampersand sign (&) as the last
character of the variable name.
• They are stored as 4 bytes ranging in value from -2,147,483,648 to + 2,147,483,648
• For example: A& = 5023456
26
Continue……
Numeric Variable
▪ Single Precision
• Single Precision variable is declared by using a exclamation sign (!) as the last
character of the variable name
• They are stored as 2 bytes ranging in value from -3.37 x 10^38 to + 3.3 x 10^38.
• The declaration of a variable as single precision and exceeds seven digits is rounded
to its closest value.
• Although the seventh digit is displayed, its accuracy is not dependable.
• For example: A! = 123.4567
27
Continue……
Numeric Variable
▪ Double Precision
• Double Precision variable is declared by using a Hash sign (#) as the last character of
the variable name
• They are stored as 4 bytes ranging in value from -1.67 x 10^308 to + 1.67 x 10^308.
• The declaration of a variable as double precision and exceeds 16 digits is rounded to
its closest value.
• For example: Count# = 123.4567
28
String Variable
▪ String variables represents numbers, alphabets, and special characters.
▪ This variable should:
• begin with an alphabet.
• end with dollar sign($).
• be of more than one characters and numbers but no special characters
are allowed
▪ Data are stored inside double quotation.
▪ Example: A$ = “Hello world”
29
Constant
▪ Constant is a value stored in a program which does not change during program
execution.
▪ Based on the type of data, it is classified into two types:
• Numeric Constant
• Numeric constant is a numeric value on which mathematical operations
such as addition, subtraction, multiplication and division can be
performed.
• It consists of sequence of digits (0-9) with or without decimal point.
• It can be a positive or negative numbers.
• Example: 17, -54, 23.5, -7.5.
30
Continue……
Constant
• String constant is a set of alphanumeric or special characters enclosed within
double quotes.
• Blank spaces can also be used in a string.
• These type of data cannot be used for mathematical calculations but can be used for
comparisons and references.
• For example: “Computer Science”, “Fluorescent”
• String Constant
• Symbolic Constant
• Symbolic constant is used when a value is not expected to change during the
execution of the program.
• The CONST statement is a non-executable statement that declares symbolic
constants.
• For example: CONST PI = 22/7
31
Operator and Expression
▪ An operator is a symbol representing the operations they perform on
operands in a program.
▪ The value on which the operators work are referred to as operands.
▪ An expression is a programming statements that has a value.
▪ It is composed of operators and operands.
▪ Operators perform mathematical or logical operations on values
▪ Types of Operators.
• Arithmetic operators.
• Relational operators.
• Logical operators.
• String operators.
Arithmetic operators
32
▪ Arithmetic operators performs arithmetic operations on the numeric
values or on the variables holding numeric values.
▪ An expression formed with arithmetic operators is termed as arithmetic
expressions.
Operators Operations Example Result
^ Exponential X = 2 ^3 X = 8
- Negation x = -y X = -(9-3) X = - 6
* Multiplication X = 3 *3 X = 9
/ Floating-point Division X = 5/2 X = 2.5
 Integer Division X = 52 X = 2
MOD Modulus Division X = 5 MOD 2 X = 1
+ Addition X = 3 + 4 X = 7
- Subtraction X = 6 – 3 X = 3
Relational operators
33
▪ Relational operators are used to evaluate and compare two values of the
same type, either both numeric or both string.
▪ The result of comparison is either TRUE or FALSE.
Operators Operations Example Result
= Equal 6 = 5 False
< Less than 6<5 False
>
Greater than 6>5
5>6
True
False
<=
Less than or equal to 6<=5
5<=6
False
True
>=
Greater than or equal to 6>=5
5>=6
True
False
<> Not equal to 6<>5 True
Logical operators
34
▪ Logical operators are used to connect two or more relational expressions
to evaluate a single value as True or False.
▪ The logical operators supported by QBASIC are:
▪ AND operator
• When two logical expressions are combined using AND logical
operator, the entire logic operation will be TRUE only if both the
logical expressions are individually TRUE.
▪ OR operator
• The entire logic operation in this case will be TRUE if either of
the logical expression is TRUE.
▪ NOT operator
• Not is a negative check operator. It operates with one operand
• It is used to reverse the logical state of its operand. If a
condition is true, then Logical NOT operator will make it false.
Logical operators
35
▪ Truth Table
Value (A) Value (B) A AND B A OR B NOT A
F F F F T
F T F T T
T F F T F
T T T T F
36
Concatenation Operator
▪ An expression involving string variables and constants is called string
expression.
▪ Concatenation operators connect multiple strings into a single string.
▪ QBASIC use the plus sign (+) as a string concatenation operator.
▪ QBASIC use the plus sign (+) as a string concatenation operator.
THANKS!
Any questions?
You can find me at
@https://www.slideshare.net/RoshanMaharjan13
& fsscomputer2020@gmail.com
37

More Related Content

What's hot

Introduction to css & its attributes with syntax
Introduction to css & its attributes with syntaxIntroduction to css & its attributes with syntax
Introduction to css & its attributes with syntax
priyadharshini murugan
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
Himanshu Pathak
 
Css
CssCss
CSS
CSSCSS
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
Webtech Learning
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 
Microsoft Word Home tab Presentation
Microsoft Word Home tab PresentationMicrosoft Word Home tab Presentation
Microsoft Word Home tab Presentation
Tanveer Ahmed
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
satvirsandhu9
 
HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
Nisa Soomro
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
div tag.pdf
div tag.pdfdiv tag.pdf
Word 2016
Word 2016Word 2016
Word 2016
Bibhuti Behera
 
Html ppt
Html pptHtml ppt
Html ppt
Ruchi Kumari
 
Ms Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer CentreMs Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer Centre
jatin batra
 
Html training slide
Html training slideHtml training slide
Html training slide
villupuramtraining
 
Training On Microsoft Excel
Training On Microsoft ExcelTraining On Microsoft Excel
Training On Microsoft Excel
TimesRide
 
Libre Office Calc Lesson 1: Introduction to spreadsheets
Libre Office Calc Lesson 1: Introduction to spreadsheetsLibre Office Calc Lesson 1: Introduction to spreadsheets
Libre Office Calc Lesson 1: Introduction to spreadsheets
Smart Chicago Collaborative
 
css.ppt
css.pptcss.ppt
css.ppt
bhasula
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Ameer Khan
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav
 

What's hot (20)

Introduction to css & its attributes with syntax
Introduction to css & its attributes with syntaxIntroduction to css & its attributes with syntax
Introduction to css & its attributes with syntax
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
 
Css
CssCss
Css
 
CSS
CSSCSS
CSS
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Microsoft Word Home tab Presentation
Microsoft Word Home tab PresentationMicrosoft Word Home tab Presentation
Microsoft Word Home tab Presentation
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
div tag.pdf
div tag.pdfdiv tag.pdf
div tag.pdf
 
Word 2016
Word 2016Word 2016
Word 2016
 
Html ppt
Html pptHtml ppt
Html ppt
 
Ms Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer CentreMs Word 2010 Training In Ambala ! Batra Computer Centre
Ms Word 2010 Training In Ambala ! Batra Computer Centre
 
Html training slide
Html training slideHtml training slide
Html training slide
 
Training On Microsoft Excel
Training On Microsoft ExcelTraining On Microsoft Excel
Training On Microsoft Excel
 
Libre Office Calc Lesson 1: Introduction to spreadsheets
Libre Office Calc Lesson 1: Introduction to spreadsheetsLibre Office Calc Lesson 1: Introduction to spreadsheets
Libre Office Calc Lesson 1: Introduction to spreadsheets
 
css.ppt
css.pptcss.ppt
css.ppt
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 

Similar to Basic of qbasic

Qbesic programming class 9
Qbesic programming class 9Qbesic programming class 9
Qbesic programming class 9
bhuwanbist1
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
MamataAnilgod
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
shashikant pabari
 
Introduction of c_language
Introduction of c_languageIntroduction of c_language
Introduction of c_language
SINGH PROJECTS
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
floraaluoch3
 
c-programming
c-programmingc-programming
c-programming
Zulhazmi Harith
 
Programming fundamental 02.pptx
Programming fundamental 02.pptxProgramming fundamental 02.pptx
Programming fundamental 02.pptx
ZubairAli256321
 
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdfL2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
MMRF2
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
CSC111-Chap_02.pdf
CSC111-Chap_02.pdfCSC111-Chap_02.pdf
CSC111-Chap_02.pdf
2b75fd3051
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
RishiBhardwaj65
 
C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1
Ali Raza Jilani
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
Chitrank Dixit
 
Basic of the C language
Basic of the C languageBasic of the C language
Basic of the C language
Sachin Verma
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming LanguageCSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
Zubayer Farazi
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
Rasan Samarasinghe
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
Lamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ckLamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ck
seidounsemel
 

Similar to Basic of qbasic (20)

Qbesic programming class 9
Qbesic programming class 9Qbesic programming class 9
Qbesic programming class 9
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
 
Introduction of c_language
Introduction of c_languageIntroduction of c_language
Introduction of c_language
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
 
c-programming
c-programmingc-programming
c-programming
 
Programming fundamental 02.pptx
Programming fundamental 02.pptxProgramming fundamental 02.pptx
Programming fundamental 02.pptx
 
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdfL2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
L2 C# Programming Comments, Keywords, Identifiers, Variables.pdf
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Chap 1 and 2
 
CSC111-Chap_02.pdf
CSC111-Chap_02.pdfCSC111-Chap_02.pdf
CSC111-Chap_02.pdf
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
 
C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1
 
C programming language
C programming languageC programming language
C programming language
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
 
Basic of the C language
Basic of the C languageBasic of the C language
Basic of the C language
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming LanguageCSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
Lamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ckLamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ck
 

More from RoshanMaharjan13

E-Commerce.pptx
E-Commerce.pptxE-Commerce.pptx
E-Commerce.pptx
RoshanMaharjan13
 
Computer security
Computer securityComputer security
Computer security
RoshanMaharjan13
 
File handling
File handlingFile handling
File handling
RoshanMaharjan13
 
Ethical and Social Issues in ICT
Ethical and Social Issues in ICTEthical and Social Issues in ICT
Ethical and Social Issues in ICT
RoshanMaharjan13
 
Ms access
Ms accessMs access
Ms access
RoshanMaharjan13
 
Ms access
Ms accessMs access
Ms access
RoshanMaharjan13
 
Computer Software
Computer SoftwareComputer Software
Computer Software
RoshanMaharjan13
 
Number system
Number systemNumber system
Number system
RoshanMaharjan13
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
RoshanMaharjan13
 
Networking and telecommunication
Networking and telecommunication Networking and telecommunication
Networking and telecommunication
RoshanMaharjan13
 
Categories of computer
Categories of computerCategories of computer
Categories of computer
RoshanMaharjan13
 
Microsoft word
Microsoft wordMicrosoft word
Microsoft word
RoshanMaharjan13
 
Modular programming
Modular programmingModular programming
Modular programming
RoshanMaharjan13
 
Introduction to computer
Introduction to computerIntroduction to computer
Introduction to computer
RoshanMaharjan13
 

More from RoshanMaharjan13 (14)

E-Commerce.pptx
E-Commerce.pptxE-Commerce.pptx
E-Commerce.pptx
 
Computer security
Computer securityComputer security
Computer security
 
File handling
File handlingFile handling
File handling
 
Ethical and Social Issues in ICT
Ethical and Social Issues in ICTEthical and Social Issues in ICT
Ethical and Social Issues in ICT
 
Ms access
Ms accessMs access
Ms access
 
Ms access
Ms accessMs access
Ms access
 
Computer Software
Computer SoftwareComputer Software
Computer Software
 
Number system
Number systemNumber system
Number system
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
Networking and telecommunication
Networking and telecommunication Networking and telecommunication
Networking and telecommunication
 
Categories of computer
Categories of computerCategories of computer
Categories of computer
 
Microsoft word
Microsoft wordMicrosoft word
Microsoft word
 
Modular programming
Modular programmingModular programming
Modular programming
 
Introduction to computer
Introduction to computerIntroduction to computer
Introduction to computer
 

Recently uploaded

বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

Basic of qbasic

  • 1. Hello! & Namaste I am Roshan Maharjan I am here because I love to give presentations. You can find me at @https://slideshare.net/RoshanMaharjan13 @fsscomputer2020@gmail.com 1
  • 2. Basics of QBASIC By: Roshan Maharjan
  • 3. OUTLINES ➢ Identify the special features of QBASIC. ➢ Explain the elements of QBASIC programming. ➢ Identify the various methods of declaring variables. ➢ Explain the importance of QBASIC syntax. 3
  • 4. “Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.” – Thomas A. Edison 4
  • 6. Introduction ▪ QBasic is a simple programming language developed by Microsoft to type, edit, debug and execute BASIC programs. ▪ A QBasic program consists of various elements. They are a character set, constants, variables, statements, operators and expressions. ▪ A QBasic statement is a command or set of instructions to perform a certain task. ▪ BASIC is an interpreter which means it reads every line, translate it and lets the computer execute it before reading another. ▪ Each instruction starts with a line number. 6
  • 7. Features ▪ It is simple and easy to learn. ▪ It is an interpreter having its own editor. ▪ It has dynamic program debugging ▪ It supports the local and global variable. ▪ It supports modular programming. ▪ It capitalizes the reserved words automatically. ▪ The syntaxes of the statements are checked automatically 7
  • 8. Starting with QBASIC 8 This is the Program Area Immediate Window
  • 9. Starting QBASIC ▪ QBASIC may not be on your computer. ▪ At first, you need to have QBASIC in your computer. ▪ It is freely available. You can download it from the Internet as well.. QBASIC Interface 9
  • 10. Components of Qbasic Menu Bar It Consists of a list of menus like file, edit, view, search, Run, options and help. Program Window The upper window tittles “untitled” is the window where you write the complete program. F5 key is pressed to execute or run the program to get the result. Immediate Window The lower window is titled immediate window where the simple statements are typed which get executed immediately. Errors are displayed here. 10 Status Bar It shows shortcut keys and location of the cursor on the screen.
  • 11. File Menu Options 11 File Menu New Clears the current program. Open Loads a program from the desk. Save Saves the current program to disk. Save As Saves the program, but under a different name. Print Prints the selected text, current window, or entire program. Exit Closes the QBASIC interpreter.
  • 12. Edit Menu Options 12 Edit Menu Cut Removes the selected text and stores it in the clipboard. Copy Copies the selected text instead of removing it. Paste Adds the text in the clipboard to the current position of the cursor. Clear Removes the text without storing it on the clipboard. New Sub Enables you to create a new subroutine New Function Enables you to create a new function
  • 13. View Menu Options 13 View Menu SUBs Shows the list of current subroutines and functions. Split Displays the contents of the current program in two windows. If the window is already split, this hides the second window. Output Screen Shows the Qbasic output screen
  • 14. Search Menu Options 14 Search Menu Find Allow you to search for a string of text in the program Repeat Last Find Continues the previous search operation Change Replaces each instance of a string with another string
  • 15. Run Menu Options 15 Run Menu Start Allow you to search for a string of text in the program Restart Continues the previous search operation Continue Replaces each instance of a string with another string
  • 16. Debug Menu Options 16 Debug Menu Step Processes the next command Procedure Step Processes the next command, does not show Qbasic going inside a subroutine or function. Trace On Shows the command that is being executed while the program is running. Toggle Breakpoint Sets or removes a breakpoint. Set Next Statement Allows you to continue execution at the special line
  • 17. Help Menu Options 17 Help Menu Index To display the help index by listing all the commands, keywords, operators, etc Contents To display the help table of content Topic To display information on a topic determined by the current location of the cursor. Using Help Displays information on using QBASIC help. About Shows information about the QBASIC interpreter
  • 18. ▪ Character Sets ▪ Keywords ▪ Variable ▪ Constants ▪ Operators, expressions and operand ▪ Program statements 18 Elements of QBASIC
  • 19. Character set is a set of valid characters that a language can recognize. A character represents any letter, digit, or any other sign. The QBASIC has the following character sets: ▪ Alphabets A, B.. Z, a, b, c,.....z. ▪ Number 0-9. ▪ Special symbols like ;,=, +,-,/,*,( ),%, $, #, &, ?,<, >etc. Character Set 19
  • 20. ▪ Keywords are the words that convey a special meaning to the language. ▪ These are reserved for special purpose and must not be used as normal identifier names. ▪ Some of the QBASIC keywords are: REM, CLS, INPUT, LET, PRINT and END Keywords (Reserved Words) 20 🔑
  • 21. Variable 21 ▪ Variables are the memory locations in the computer’s memory for storing data. ▪ They provide an “interface” to RAM. ▪ They are the containers that holds the information. ▪ Their sole purpose is to label and store the data in memory so that can be used throughout the program.
  • 22. The variable names have the following properties: 22 Continue…… Variable - Naming Conventions ▪ Any Variable name may be up to 40 characters long. ▪ Variable names must begin with a letter ( A…Z, a…z ). ▪ Cannot contain characters other than letters, numbers, period, and the type declaration characters ($, %, #, &, and ! ). ▪ Cannot be a reserved words, although embedded reserved words are allowed. ▪ Variable may represent either numeric values or string. ▪ Cannot begin with “FN” unless it is a function call.
  • 23. Variables occur in two distinct types i.e. numeric variable and string variable depending upon data item they represent. 23 Continue…… Types of variables ▪ Numeric Variable • Numeric variables store numeric data. • It’s name can be formed by letters and digits. • It should however always begin with an alphabet and should not contain any special characters or spaces. • For example, (i) age = 30 (ii) mark1 = 73.6. Here age is a numeric variable which stores the constant value 30. • Numeric variables may be declared as:
  • 24. 24 Continue…… Numeric Variable ▪ Integers • Integer variable is declared by using a percent sign (%) as the last character of the variable name • They are stored as 2 bytes ranging in value from -32768 to +32767. • The declaration of a variable as an integer causes the variable’s value to be rounded to the closest integer. • For example: A% = 50 • They accept only non-decimal values i.e real values
  • 25. 25 Continue…… Numeric Variable ▪ Long Integers • Long Integer variable is declared by using a ampersand sign (&) as the last character of the variable name. • They are stored as 4 bytes ranging in value from -2,147,483,648 to + 2,147,483,648 • For example: A& = 5023456
  • 26. 26 Continue…… Numeric Variable ▪ Single Precision • Single Precision variable is declared by using a exclamation sign (!) as the last character of the variable name • They are stored as 2 bytes ranging in value from -3.37 x 10^38 to + 3.3 x 10^38. • The declaration of a variable as single precision and exceeds seven digits is rounded to its closest value. • Although the seventh digit is displayed, its accuracy is not dependable. • For example: A! = 123.4567
  • 27. 27 Continue…… Numeric Variable ▪ Double Precision • Double Precision variable is declared by using a Hash sign (#) as the last character of the variable name • They are stored as 4 bytes ranging in value from -1.67 x 10^308 to + 1.67 x 10^308. • The declaration of a variable as double precision and exceeds 16 digits is rounded to its closest value. • For example: Count# = 123.4567
  • 28. 28 String Variable ▪ String variables represents numbers, alphabets, and special characters. ▪ This variable should: • begin with an alphabet. • end with dollar sign($). • be of more than one characters and numbers but no special characters are allowed ▪ Data are stored inside double quotation. ▪ Example: A$ = “Hello world”
  • 29. 29 Constant ▪ Constant is a value stored in a program which does not change during program execution. ▪ Based on the type of data, it is classified into two types: • Numeric Constant • Numeric constant is a numeric value on which mathematical operations such as addition, subtraction, multiplication and division can be performed. • It consists of sequence of digits (0-9) with or without decimal point. • It can be a positive or negative numbers. • Example: 17, -54, 23.5, -7.5.
  • 30. 30 Continue…… Constant • String constant is a set of alphanumeric or special characters enclosed within double quotes. • Blank spaces can also be used in a string. • These type of data cannot be used for mathematical calculations but can be used for comparisons and references. • For example: “Computer Science”, “Fluorescent” • String Constant • Symbolic Constant • Symbolic constant is used when a value is not expected to change during the execution of the program. • The CONST statement is a non-executable statement that declares symbolic constants. • For example: CONST PI = 22/7
  • 31. 31 Operator and Expression ▪ An operator is a symbol representing the operations they perform on operands in a program. ▪ The value on which the operators work are referred to as operands. ▪ An expression is a programming statements that has a value. ▪ It is composed of operators and operands. ▪ Operators perform mathematical or logical operations on values ▪ Types of Operators. • Arithmetic operators. • Relational operators. • Logical operators. • String operators.
  • 32. Arithmetic operators 32 ▪ Arithmetic operators performs arithmetic operations on the numeric values or on the variables holding numeric values. ▪ An expression formed with arithmetic operators is termed as arithmetic expressions. Operators Operations Example Result ^ Exponential X = 2 ^3 X = 8 - Negation x = -y X = -(9-3) X = - 6 * Multiplication X = 3 *3 X = 9 / Floating-point Division X = 5/2 X = 2.5 Integer Division X = 52 X = 2 MOD Modulus Division X = 5 MOD 2 X = 1 + Addition X = 3 + 4 X = 7 - Subtraction X = 6 – 3 X = 3
  • 33. Relational operators 33 ▪ Relational operators are used to evaluate and compare two values of the same type, either both numeric or both string. ▪ The result of comparison is either TRUE or FALSE. Operators Operations Example Result = Equal 6 = 5 False < Less than 6<5 False > Greater than 6>5 5>6 True False <= Less than or equal to 6<=5 5<=6 False True >= Greater than or equal to 6>=5 5>=6 True False <> Not equal to 6<>5 True
  • 34. Logical operators 34 ▪ Logical operators are used to connect two or more relational expressions to evaluate a single value as True or False. ▪ The logical operators supported by QBASIC are: ▪ AND operator • When two logical expressions are combined using AND logical operator, the entire logic operation will be TRUE only if both the logical expressions are individually TRUE. ▪ OR operator • The entire logic operation in this case will be TRUE if either of the logical expression is TRUE. ▪ NOT operator • Not is a negative check operator. It operates with one operand • It is used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make it false.
  • 35. Logical operators 35 ▪ Truth Table Value (A) Value (B) A AND B A OR B NOT A F F F F T F T F T T T F F T F T T T T F
  • 36. 36 Concatenation Operator ▪ An expression involving string variables and constants is called string expression. ▪ Concatenation operators connect multiple strings into a single string. ▪ QBASIC use the plus sign (+) as a string concatenation operator. ▪ QBASIC use the plus sign (+) as a string concatenation operator.
  • 37. THANKS! Any questions? You can find me at @https://www.slideshare.net/RoshanMaharjan13 & fsscomputer2020@gmail.com 37