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

CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMRc Os
 
Basic structure of C++ program
Basic structure of C++ programBasic structure of C++ program
Basic structure of C++ programmatiur rahman
 
89 identify the parts of a window desktop and common desktop icons
89 identify the parts of a window desktop and common desktop icons89 identify the parts of a window desktop and common desktop icons
89 identify the parts of a window desktop and common desktop iconsPaul Gonzales
 
Microsoft Office Introduction
Microsoft Office IntroductionMicrosoft Office Introduction
Microsoft Office IntroductionAnitha Rao
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithmsStudent
 
Presentation on different kinds of software
Presentation on different kinds of softwarePresentation on different kinds of software
Presentation on different kinds of softwareNitish Xavier Tirkey
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to PseudocodeDamian T. Gordon
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer ProgrammingAllen de Castro
 
Computer System Overview Class XI CS
Computer System Overview Class XI CSComputer System Overview Class XI CS
Computer System Overview Class XI CSclass12sci
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchartfika sweety
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
Network software n othr types of software
Network software n othr types of software Network software n othr types of software
Network software n othr types of software Dhani Ahmad
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 
Important Shortcut Keys of Computer keyboard
Important Shortcut Keys of Computer keyboardImportant Shortcut Keys of Computer keyboard
Important Shortcut Keys of Computer keyboardjakskhan4u
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 

La actualidad más candente (20)

Pseudocode
PseudocodePseudocode
Pseudocode
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
 
Introduction to loops
Introduction to loopsIntroduction to loops
Introduction to loops
 
Basic of qbasic
Basic of qbasicBasic of qbasic
Basic of qbasic
 
Basic structure of C++ program
Basic structure of C++ programBasic structure of C++ program
Basic structure of C++ program
 
89 identify the parts of a window desktop and common desktop icons
89 identify the parts of a window desktop and common desktop icons89 identify the parts of a window desktop and common desktop icons
89 identify the parts of a window desktop and common desktop icons
 
Microsoft Office Introduction
Microsoft Office IntroductionMicrosoft Office Introduction
Microsoft Office Introduction
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 
Presentation on different kinds of software
Presentation on different kinds of softwarePresentation on different kinds of software
Presentation on different kinds of software
 
Algo and flowchart
Algo and flowchartAlgo and flowchart
Algo and flowchart
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 
Computer System Overview Class XI CS
Computer System Overview Class XI CSComputer System Overview Class XI CS
Computer System Overview Class XI CS
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Network software n othr types of software
Network software n othr types of software Network software n othr types of software
Network software n othr types of software
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Important Shortcut Keys of Computer keyboard
Important Shortcut Keys of Computer keyboardImportant Shortcut Keys of Computer keyboard
Important Shortcut Keys of Computer keyboard
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 

Similar a Qbasic

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 cstechzShahbaz Ahmad
 
QBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingQBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingGifty Belle Manaois
 
QBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingQBASIC: A Tool For Modern Programming
QBASIC: A Tool For Modern ProgrammingGifty Belle Manaois
 
02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptxarifaqazi2
 
Qbesic programming class 9
Qbesic programming class 9Qbesic programming class 9
Qbesic programming class 9bhuwanbist1
 
Computer science 3rd Term Notes
Computer science 3rd Term NotesComputer science 3rd Term Notes
Computer science 3rd Term NotesJohnBernard46
 
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].pptxKaavyaGaur1
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
Assembly Language Programming
Assembly Language ProgrammingAssembly Language Programming
Assembly Language ProgrammingNiropam Das
 

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
 
Qbasic introduction
Qbasic introductionQbasic introduction
Qbasic introduction
 
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
 

Más de Shubham Gupta

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

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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.pptxDr. Sarita Anand
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
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 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
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.MaryamAhmad92
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Último (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
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
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
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
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

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.