SlideServe
Menu
Préférences
© SlideServe · v2026

QBasic

nate avatar
11 diapositives · 2K Views · Jun 05, 2012

QBasic. Chapter 3 – Fundamental Statements. QBasic Statement Components. Keywords Constants Numeric constants Real numbers – include decimal points Integers – w/out decimal points No commas, symbols (only – sign) or blank spaces Exponential notation is used. QBasic Statement Components.

QBasic - slide 1
01 / 11QBasic
1 / 17

Télécharger la présentation

QBasic
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. QBasic Chapter 3 – Fundamental Statements

  2. QBasic Statement Components • Keywords • Constants • Numeric constants • Real numbers – include decimal points • Integers – w/out decimal points • No commas, symbols (only – sign) or blank spaces • Exponential notation is used

  3. QBasic Statement Components • Constants • Character string constants • Alphanumeric data • Only one set of double quotes • Length of a string – max 32,767 characters • Variables • Can only store one value at a time • Referred to by addresses • Variables are named • Only first 40 characters are recognized in QBasic • QBasic does not differentiate between upper & lowercase • Use descriptive variable names

  4. QBasic Statement Components • Numeric Variables • Supplied by the programmer or • Calculated during program execution • Begins with a letter, followed by letters, digits, and periods • Cannot have blank spaces

  5. QBasic Statement Components • String Variables • Stores character strings • Begins with a letter followed by letters or digits and always end with a $ • Keywords • Cannot be used as variable names • READ, LIST, PRINT, LET and END

  6. Simple QBasic Statements • CLS – Clear Screen • Documenting a Program • REM • Single quotation mark (‘) • Can be used anywhere in the program REM **** This program was created by *** ‘ This program was created by

  7. Simple QBasic Statements • Assigning Values to Variables • Assignment Statement • LET keyword is optional LET Rate = .0825 LET Tuition = 50.00 Heading$ = “Inventory Report” Classification = 4

  8. Simple QBasic Statements • Arithmetic Operations • Composed of numeric constants, numeric variables, and arithmetic operators • +, -, /, *, ^ LET Tuition = Hours * 50 Order of Operations - PEMDAS

  9. Simple QBasic Statements • Displaying Results • PRINT PRINT Heading$, Tuition would result in: Your tuition amount is 400.00 • Displaying Literals • Group of characters containing just about anything PRINT “JUNK $%^ 4567” would result in: JUNK $%^ 4567

  10. Simple QBasic Statements • END • Stops program execution • Immediate Window • Execute statements as soon as ENTER is pressed

  11. Simple QBasic Statements • HELP • F1 key or HELP menu • Highlight menu option & then press F1 or right mouse button • Press ESC to close HELP screen • Alt-H for list of HELP topics • Smart Editor