1 / 11

TrueBASIC Ch 2 & 3 Sample Problems

TrueBASIC Ch 2 & 3 Sample Problems. What are the errors? (2 total). PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50. What are the errors? (2 total). PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50 END.

blithe
Download Presentation

TrueBASIC Ch 2 & 3 Sample Problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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

More Related