Presentation is loading. Please wait.

Presentation is loading. Please wait.

True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END.

Similar presentations


Presentation on theme: "True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END."— Presentation transcript:

1 True BASIC Ch. 6 Practice Questions

2 What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END

3 What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END 0 4 6

4 What are the 4 errors? ! doubler FOR A = 1 : 5 STEP 3 INPUT "What is X? ": X PRINT "2 * X = ",(2*X) NEXT

5 What are the 4 errors? ! doubler FOR A = 1 TO 5 STEP 3 INPUT PROMPT "What is X? ": X PRINT "2 * X = ",(2*X) NEXT A END 1) Range in counted loop must use TO 2) Must use INPUT PROMPT if providing text to user 3) Count Variable must be specified in NEXT statement 4) All programs must finish with END

6 What is the output? FOR X = 1 TO 2 FOR Y = 4 TO 5 PRINT X;"*";Y;"=";(X*Y) NEXT Y NEXT X END

7 What is the output? FOR X = 1 TO 2 FOR Y = 4 TO 5 PRINT X;"*";Y;"=";(X*Y) NEXT Y NEXT X END 1 * 4 = 4 1 * 5 = 5 2 * 4 = 8 2 * 5 = 10

8 What are the 3 errors? FOR Y = 1 TO 10 INCREMENT 1 INPUT J IF J IS 0 THEN PRINT "zero" ENDIF REM NEXT X NEXT Y END

9 What are the 3 errors? FOR Y = 1 TO 10 STEP 1 INPUT J IF J = 0 THEN PRINT "zero" END IF REM NEXT X NEXT Y END 1)Amount added to counter variable is specified by keyword STEP 2)Equality in IF condition is specified by equal sign ‘=‘ 3)END IF command is two words


Download ppt "True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END."

Similar presentations


Ads by Google