Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "TrueBASIC Ch 2 & 3 Sample Problems. What are the errors? (2 total) PRINT "REM" LET REM = 50 reAD currency$, amount DAta "Dollar", 50."— 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 1.REM is a keyword, cannot be used as a variable 2.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 LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whats goin", " on" END

9 What are the errors? REM LET x = "5000" LET string$s = "Good Evening" LET 1number = 44 PRINT "I dunno";" whats goin", " 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= 3y= 5 x= 3y= 4


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

Similar presentations


Ads by Google