programming : qbasic
Post on 18-Jul-2015
Embed Size (px)
COMPUTER PROGRAMMING:Q-BasicIntroductionInterfaceFeaturesRulesDataTypes of ModeKeywordsCommandsRemindersSimple Activity
BEGINNERS ALL PURPOSE SYMBOLIC INSTRUCTION CODE
Q-Basic : IntroductionV. Nuval | C. RepolloIt was invented in 1963 at Dartmouth CollegeIt is an interpreter which means it reads every line, translates it and lets the computer execute it before reading another.The founders are John George Kemeny and Tom Kurtzas
Q-Basic : Interface V. Nuval | C. Repollo
Q-Basic : FeaturesV. Nuval | C. RepolloIt is a user friendly language.It is widely known and accepted programming language.It is one of the most flexible languages , as modification can easily be done in already existing programs.
Language is easy since the variables can be named easily and uses simple English phrases with mathematical expressions.
Q-Basic : RulesV. Nuval | C. RepolloAll Q-basic language are made up of series of statements, which are executed in the order in which they are written.Every statements should have at least one Q-Basic command word. The words that BASIC recognizes are called KEYWORDS.All the command words have to be written using some standard rules , which are called Syntax Rules. Syntax is the grammar of writing the statement in a language. Syntax errors are generated when improper syntax is detected.
Data is a collection of facts and figures that is entered into the computer through the keyboard. Data is of two types: Constant and Variable.Q-Basic : DataV. Nuval | C. RepolloCONSTANT : Data whose value does not change
Numeric Constant : negative or positive numbers.Alphanumeric Constant : Numbers or alphabets written within double qoutes.
V. Nuval | C. RepolloVariable : Data whose value is not constant.Numeric Variable : variable that holds a numeric constant for calculations.Alphanumeric Variables : variable that holds an alphanumeric variable which cannot be used for calculations.
Direct Mode : It accepts single line instructions from the user and the output is viewed as soon as enter key is pressed.Program Mode : It is used to type program which is stored in the memory, They have line numbers.Q-Basic : Types of ModeV. Nuval | C. Repollo
1.) LIST is used to list the program on the screen.2.) RUN is used to execute the program.3.) LLIST is used to list the program as a hardcopy.4.) LPRINt is used to get the output of the program on the hard copy.5.) NEW is used to clear the memory of the existing program.6.) SYSTEM is used to take you back to the dos prompt7.) PRINT is used to view the display on the screen8.) CLS is used to clear the screen.9.) RME is used to show the position of the mistake.10.) SAVE is used to save the program.11.) LOAD is used to load the program from the disk to the memory.Q-Basic : KeywordsV. Nuval | C. Repollo
CLS is used to clear the screen.PRINT is used to display the output on the screen.REM gives an explanation of the program or the statement in the program thereby making the program more understandable to do the reader.LET assigns a value to a variable in a program.END is used at the end of the program to signal ending.INPUT allows the user to enter a value for the variable while running the program.DELETE is used to delete a line number in a program.
Q-Basic : CommandsV. Nuval | C. Repollo
A Q-Basic program consists of the lines containing:
1.) a line number2.) A Q-Basic keyword like PRINT,END etc.3.) Each program line begins with positive number.4.) No two lines should have same numbers.Q-Basic : RemindersV. Nuval | C. Repollo
RUN is the command used to execute the program and get the output on the screen.Q-Basic : Running a programV. Nuval | C. Repollo
It is possible to overwrite lines with the new statements, but if you want to write a totally new program , use a NEW commandQ-Basic : Writing a New ProgramV. Nuval | C. Repollo
In order to exit the Q-Basic program SYSTEM command is used.Q-Basic : Exiting V. Nuval | C. Repollo
Command is a special function that tells the Q-Basic interpreter to do something.
The PRINT command tells the Q-Basic interpreter to print something to the screen. Q-Basic : Terms to RememberV. Nuval | C. RepolloPRINT HELLO WORLDFIRST PROGRAMMED WORDS IN THE HISTORY.
An expression is something that interpreter calculates.
Q-Basic : Terms to RememberV. Nuval | C. Repollo1+1(returns 2)100-47(returns 53)
AND NOW YOU CAN START A SIMPLE PROGRAM USING Q-BASIC !V. Nuval | C. Repollo
THANK YOUV. Nuval | C. Repollo
ABOUT THE AUTHORSV. Nuval | C. RepolloVALERIE NUVAL AND CHARLEEN REPOLLO ARE STUDENTS AT JUAN G. MACARAEG NATIONAL HIGH SCHOOL LOCATED AT BINALONAN,PANGASINAN,PHILIPPINES. THIS SLIDESHOW IS MADE AND UPLOADED AS A PROJECT FOR THEIR COMPUTER PROGRAMMING CLASS AND WILL BE PASSED TO THEIR SUBJECT TEACHER MR.ANGEL CORONA.