SlideServe
Menu
Préférences
© SlideServe · v2026

Error Analysis of TrueBASIC Sample Problems

blithe avatar
11 diapositives · 234 Views · Aug 26, 2014

This document analyzes common errors found in TrueBASIC sample problems related to variables, data handling, and output generation. It highlights issues such as the improper use of keywords (e.g., using "REM" as a variable), missing statements, and incorrect syntax in read and print operations. The program output is examined, demonstrating how variable assignments and data reading can lead to errors or unexpected results. It is aimed at helping beginners in programming to understand and resolve typical mistakes in coding.

Error Analysis of TrueBASIC Sample Problems - slide 1
01 / 11Error Analysis of TrueBASIC Sample Problems
1 / 17

Télécharger la présentation

Error Analysis of TrueBASIC Sample Problems
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. TrueBASIC Ch 2 & 3 Sample Problems

  2. What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50

  3. What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50 END • REM is a keyword, cannot be used as a variable • Missing END statement

  4. What is the output? DATA 1000, 5, "fraternity power walk" READ attendees, ticket_price LET revenue = attendees * ticket_price READ event$ DATA 5, "the fraternity power walk" PRINT event$; " generated $";revenue END

  5. What is the output? DATA 1000, 5, "fraternity power walk" READ attendees, ticket_price LET revenue = attendees * ticket_price READ event$ DATA 5, "the fraternity power walk" PRINT event$; " generated $";revenue END the fraternity power walk generated $ 5000

  6. What is the error? READ yo$, I, got DATA "$",523,432 DATA "100",100 READ number$ READ name PRINT "number": I END

  7. What is the error? READ yo$, I, got DATA "$",523,432 DATA "100",100 READ number$ READ name PRINT "number": I END Commas or Semi-colons must separate the list of arguments to PRINT (not colons)

  8. What are the errors? REM REM LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whatsgoin", " on" END

  9. What are the errors? REM REM LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whatsgoin", " on" END • Cannot assign a string to a number variable • string$s is not a valid variable name (must end with $) • 1number is not a valid variable name (cannot begin with a number)

  10. What is the output of this program? READ x READ y READ x LET y = x + 2 PRINT "x= ";x, "y= ";y DATA 1,2,3,4,5,6 READ y PRINT "x= ";x, "y= ";y END

  11. What is the output of this program? READ x READ y READ x LET y = x + 2 PRINT "x= ";x, "y= ";y DATA 1,2,3,4,5,6 READ y PRINT "x= ";x, "y= ";y END x= 3 y= 5 x= 3 y= 4