SlideShare una empresa de Scribd logo
1 de 16
PESENSENTATION ON QBASIC
By-SHUBHAM GUPTA
CLASS-6th A
ROOL NO. -27
You've probably used computers to play games, and to write
reports for school. It's a lot more fun to create your own
games to play on the computer. This book will help you get
started by using QBASIC. QBASIC is a programming
language. With a programming language you can tell the
computer what you want it to do. It's a lot like giving
someone directions to your house. The computer follows each
step and does exactly what you tell it. By programming the
computer you can solve math problems, create art or music,
and even make new games. It's all up to you.
The best way to start with this book is to type in some of
the small programs you'll find in each of the chapters. You
might need to work through Chapter 1 first. An adult can
help you get up to speed quickly. Then change the programs
to do what you want them to do. Before long, you'll be
writing your own programs.
BASIC is a programming language used for beginners.
It is very easy ad simple to understand .
BASIC stands for Beginners All Purpose Symbolic
Instruction Code. it was developed in Dartmouth
college, New Hampshire, USA by professor John G .
Kemeny and Thomas E. Kurtz in may 1964.
The main components of the given qbasic program
are:-
COMMENTS: Any text written after REN is
treated as a comments as you wish.
PROGRAM BODY: It contains the programming
statements which cause the action to be taken.
•Let us write our first and very simple QBASIC program.
•Double click on the QBASIC icon on the Desktop to start
QBASIC.
•The QBASIC window will appear with Welcome dialog box.
•Press the Esc key to hide the Welcome dialog box.
•The first window of QBASIC appears.
•Type the program, as shown in the above picture.
•QBASIC executes the program line-by-line. If it
finds any error, it displays the error message and stops
execution.
1. Click on FILE menu and select SAVE AS option .
2. Give a meaningful name to your program in the file name:
text box and press ENTER key.
3. Your file will be saved with the name given by you and
with extension .BAS will be added to automatically .
4. The file name should not exceed more then 8 characters.
RUN A PROGRAM
There are many ways to run a program in QBASIC:-
•By pressing F5 key.
•By selecting RUN menu and then click on start option .
•By typing RUN in the immediate mode and pressing ENTER
key.
A character set is a set of symbols that can be used in
programming language . BASIC uses the followings
symbols as its character set :-
1. ALPHABET-> A,B,C,D…………………Z
a,b,c,d………………….z
2. NUMBERS-> 1,2,3,4,5,6,7,8,9,0
3. SPESIAL CRAACTER-> !,@,#,$,%,^,&,*,(,),_,+,},{, etc.
CONSTANTS- The value which do not change during the
execution of program is called constant . Constants are of
two types:
1. NUMRIC CONSTANTS – Any numeric value ,an integer or
real numbers ,positive or negative numbers is called a
numeric constant .For Example 224,+12,-85 etc.
2. ALPHANUMRIC CONSTANTS- A set of characters is
called a STRING. An alphanumeric or string constant
consists of a sequence of characters ,A-Z, a-z,0-9 and
certain special symbols like %^&*( );:” ‘/.For example
“RAGHAV” ,”SUM =Rs84’,”94”.
A variable is a location in a memory to which any value can be assigned .
1. NUMERIC VARIABLE: It can contain only numeric values .It
represented by an alphabet or an alphabetfollowed by an
another aialphabet or a digit. It should not contain any space
or symbols like ^,?,,/, @ etc. Underscore can be used
whenever a space is required. For example A, C, A2, ABC etc.
represent numeric variables.
2. ALPHANUMERIC OR STRING VARIABLE : A string variable
is represented by an alphabet followed by dollar ($) singn. For
example A1$, RKL$ etc.
1. ARITHMETIC OPERATORS :
OPRETOR EXPLANATION EXAMPLE RESULT(SP
OSE A= 8, B=4)
+ To add 2 or more
numbers
Sum = a+ b 12
- To subtract two or
more numbers
Sub = a - b 4
* To multiply two or
more numbers
Mul = a*b 32
/ To divide two or
more numbers
Div = a / b 2
^ To calculate
Exponentiation
value
Exp = a ^ b 512
2. RELATIONAL OEPRATORS:
OPRETORS MEANING EXAMPLE RESULT(SP
OSE A=10,B=8)
= A = B FALSE
<> A<>B TRUE
> A>B TRUE
< A<B FALSE
>= A>=B TRUE
<= A<=B FALSE
3. LOGICAL OPERATORS : Logical operators are used to
perform logical opertion on numerical values. Logical operators
are used to combine two or more relational expressions and
return a single value as TRUE or FALSE in a decision. The
common logical operations are : AND, OR, NOT.
•Hierarchy defines the order in which the operators are
executed in any Basic expression. The full form of
BEDMAS is:-
B BRACETS ()
E Exponentiation ^
D DIVISION /
M MULTIPLICATION *
A ADDITION +
S SUBTRACTION -
The assignment statement or
Let statement, is used to assign
a value to a variable. In
QBASIC, using Let statement
and line numbers are optional.
CLS
THIS COMMAD IS USED TO
CLER SCREEN
PRINT COMMAND
•The print command is used to display any message or value.
• The print command is used to display any message or value.
• The print command is used with different variations to print
the output in different forms.
• Print using semicolon is used to print the values one after
another, without any space in between.
• This allows the printing of values one after another with plenty
of spaces in between. Only five values can be printed in one line.
In case of more than five values, the remaining values will be
printed on the next line.
• The TAB function is used to move the print position to the
column indicated in its argument. This statement is quite suitable
for printing tabular type of results. PRINT TAB statement can
be used in controlling column location.
• If you want to leave blank line in between while printing an
output, use PRINT statement in the following way.
INPUT STATEMENT
The INPUT statement in QBASIC, accepts the data item
from the user. This statement asks the user to make data
entry while the program is being executed.
While using INPUT statement, the computer does the
following things:
• It stops further processing of the program
• It prints a question mark on the screen.
• It waits for the user to key in its response and press
Enter key.
•It stores or assigns the same data item in to the
corresponding variable mentioned in the INPUT statement.

Más contenido relacionado

La actualidad más candente

Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
NSU-Biliran Campus
 

La actualidad más candente (20)

Computer languages
Computer languagesComputer languages
Computer languages
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Qbasic introduction
Qbasic introductionQbasic introduction
Qbasic introduction
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Software and its types
Software and its typesSoftware and its types
Software and its types
 
Qbasic program
Qbasic programQbasic program
Qbasic program
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
 
Libre Office Writer Lesson 1
Libre Office Writer Lesson 1Libre Office Writer Lesson 1
Libre Office Writer Lesson 1
 
Spreadsheets and Database Packages
Spreadsheets and Database PackagesSpreadsheets and Database Packages
Spreadsheets and Database Packages
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Basic of qbasic
Basic of qbasicBasic of qbasic
Basic of qbasic
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 
Presentation on input devices...
Presentation on input devices... Presentation on input devices...
Presentation on input devices...
 
Openoffice writer
Openoffice writerOpenoffice writer
Openoffice writer
 
System software and Application software
System software and Application softwareSystem software and Application software
System software and Application software
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Introduction to qbasic
Introduction to qbasicIntroduction to qbasic
Introduction to qbasic
 

Similar a Qbasic

Similar a Qbasic (20)

Qbasic tutorial
Qbasic tutorialQbasic tutorial
Qbasic tutorial
 
Qbasic notes
Qbasic notesQbasic notes
Qbasic notes
 
10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz
 
Computer programming k 12
Computer programming k 12Computer programming k 12
Computer programming k 12
 
The Knowledge of QBasic
The Knowledge of QBasicThe Knowledge of QBasic
The Knowledge of QBasic
 
QBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingQBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern Programming
 
QBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingQBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern Programming
 
02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx
 
Qbesic programming class 9
Qbesic programming class 9Qbesic programming class 9
Qbesic programming class 9
 
Q basic ch
Q basic chQ basic ch
Q basic ch
 
programming.ppt
programming.pptprogramming.ppt
programming.ppt
 
Pascal programming lecture notes
Pascal programming lecture notesPascal programming lecture notes
Pascal programming lecture notes
 
Algorithm and psuedocode
Algorithm and psuedocodeAlgorithm and psuedocode
Algorithm and psuedocode
 
Computer science 3rd Term Notes
Computer science 3rd Term NotesComputer science 3rd Term Notes
Computer science 3rd Term Notes
 
Algorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptxAlgorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptx
 
Programming
ProgrammingProgramming
Programming
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Assembly Language Programming
Assembly Language ProgrammingAssembly Language Programming
Assembly Language Programming
 
Input-output
Input-outputInput-output
Input-output
 
Computer programming
Computer programmingComputer programming
Computer programming
 

Más de Shubham Gupta (13)

Stone age
Stone ageStone age
Stone age
 
Robert frost
Robert frostRobert frost
Robert frost
 
Presentation of eye ths
Presentation of eye thsPresentation of eye ths
Presentation of eye ths
 
Mahatma gandhi in hindi
Mahatma gandhi in hindiMahatma gandhi in hindi
Mahatma gandhi in hindi
 
dowry like evils
dowry like evilsdowry like evils
dowry like evils
 
Gender inequality
Gender inequalityGender inequality
Gender inequality
 
Com ppt shubham
Com ppt shubhamCom ppt shubham
Com ppt shubham
 
The diversity of india
The diversity of indiaThe diversity of india
The diversity of india
 
Gender inequality
Gender inequalityGender inequality
Gender inequality
 
pollution
pollutionpollution
pollution
 
computer memory
computer memorycomputer memory
computer memory
 
Robert frost
Robert frostRobert frost
Robert frost
 
Presentation on eye
Presentation on eyePresentation on eye
Presentation on eye
 

Último

Último (20)

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Qbasic

  • 1. PESENSENTATION ON QBASIC By-SHUBHAM GUPTA CLASS-6th A ROOL NO. -27
  • 2. You've probably used computers to play games, and to write reports for school. It's a lot more fun to create your own games to play on the computer. This book will help you get started by using QBASIC. QBASIC is a programming language. With a programming language you can tell the computer what you want it to do. It's a lot like giving someone directions to your house. The computer follows each step and does exactly what you tell it. By programming the computer you can solve math problems, create art or music, and even make new games. It's all up to you. The best way to start with this book is to type in some of the small programs you'll find in each of the chapters. You might need to work through Chapter 1 first. An adult can help you get up to speed quickly. Then change the programs to do what you want them to do. Before long, you'll be writing your own programs.
  • 3. BASIC is a programming language used for beginners. It is very easy ad simple to understand . BASIC stands for Beginners All Purpose Symbolic Instruction Code. it was developed in Dartmouth college, New Hampshire, USA by professor John G . Kemeny and Thomas E. Kurtz in may 1964.
  • 4. The main components of the given qbasic program are:- COMMENTS: Any text written after REN is treated as a comments as you wish. PROGRAM BODY: It contains the programming statements which cause the action to be taken.
  • 5. •Let us write our first and very simple QBASIC program. •Double click on the QBASIC icon on the Desktop to start QBASIC. •The QBASIC window will appear with Welcome dialog box. •Press the Esc key to hide the Welcome dialog box. •The first window of QBASIC appears. •Type the program, as shown in the above picture. •QBASIC executes the program line-by-line. If it finds any error, it displays the error message and stops execution.
  • 6. 1. Click on FILE menu and select SAVE AS option . 2. Give a meaningful name to your program in the file name: text box and press ENTER key. 3. Your file will be saved with the name given by you and with extension .BAS will be added to automatically . 4. The file name should not exceed more then 8 characters.
  • 7. RUN A PROGRAM There are many ways to run a program in QBASIC:- •By pressing F5 key. •By selecting RUN menu and then click on start option . •By typing RUN in the immediate mode and pressing ENTER key.
  • 8. A character set is a set of symbols that can be used in programming language . BASIC uses the followings symbols as its character set :- 1. ALPHABET-> A,B,C,D…………………Z a,b,c,d………………….z 2. NUMBERS-> 1,2,3,4,5,6,7,8,9,0 3. SPESIAL CRAACTER-> !,@,#,$,%,^,&,*,(,),_,+,},{, etc.
  • 9. CONSTANTS- The value which do not change during the execution of program is called constant . Constants are of two types: 1. NUMRIC CONSTANTS – Any numeric value ,an integer or real numbers ,positive or negative numbers is called a numeric constant .For Example 224,+12,-85 etc. 2. ALPHANUMRIC CONSTANTS- A set of characters is called a STRING. An alphanumeric or string constant consists of a sequence of characters ,A-Z, a-z,0-9 and certain special symbols like %^&*( );:” ‘/.For example “RAGHAV” ,”SUM =Rs84’,”94”.
  • 10. A variable is a location in a memory to which any value can be assigned . 1. NUMERIC VARIABLE: It can contain only numeric values .It represented by an alphabet or an alphabetfollowed by an another aialphabet or a digit. It should not contain any space or symbols like ^,?,,/, @ etc. Underscore can be used whenever a space is required. For example A, C, A2, ABC etc. represent numeric variables. 2. ALPHANUMERIC OR STRING VARIABLE : A string variable is represented by an alphabet followed by dollar ($) singn. For example A1$, RKL$ etc.
  • 11. 1. ARITHMETIC OPERATORS : OPRETOR EXPLANATION EXAMPLE RESULT(SP OSE A= 8, B=4) + To add 2 or more numbers Sum = a+ b 12 - To subtract two or more numbers Sub = a - b 4 * To multiply two or more numbers Mul = a*b 32 / To divide two or more numbers Div = a / b 2 ^ To calculate Exponentiation value Exp = a ^ b 512
  • 12. 2. RELATIONAL OEPRATORS: OPRETORS MEANING EXAMPLE RESULT(SP OSE A=10,B=8) = A = B FALSE <> A<>B TRUE > A>B TRUE < A<B FALSE >= A>=B TRUE <= A<=B FALSE
  • 13. 3. LOGICAL OPERATORS : Logical operators are used to perform logical opertion on numerical values. Logical operators are used to combine two or more relational expressions and return a single value as TRUE or FALSE in a decision. The common logical operations are : AND, OR, NOT. •Hierarchy defines the order in which the operators are executed in any Basic expression. The full form of BEDMAS is:-
  • 14. B BRACETS () E Exponentiation ^ D DIVISION / M MULTIPLICATION * A ADDITION + S SUBTRACTION - The assignment statement or Let statement, is used to assign a value to a variable. In QBASIC, using Let statement and line numbers are optional. CLS THIS COMMAD IS USED TO CLER SCREEN
  • 15. PRINT COMMAND •The print command is used to display any message or value. • The print command is used to display any message or value. • The print command is used with different variations to print the output in different forms. • Print using semicolon is used to print the values one after another, without any space in between. • This allows the printing of values one after another with plenty of spaces in between. Only five values can be printed in one line. In case of more than five values, the remaining values will be printed on the next line. • The TAB function is used to move the print position to the column indicated in its argument. This statement is quite suitable for printing tabular type of results. PRINT TAB statement can be used in controlling column location. • If you want to leave blank line in between while printing an output, use PRINT statement in the following way.
  • 16. INPUT STATEMENT The INPUT statement in QBASIC, accepts the data item from the user. This statement asks the user to make data entry while the program is being executed. While using INPUT statement, the computer does the following things: • It stops further processing of the program • It prints a question mark on the screen. • It waits for the user to key in its response and press Enter key. •It stores or assigns the same data item in to the corresponding variable mentioned in the INPUT statement.