1 / 9

True BASIC Ch. 6 Practice Questions

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. What is the output?. 0 -1 4 6. PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END. What are the 4 errors?.

swain
Télécharger la présentation

True BASIC Ch. 6 Practice Questions

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. 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? 0 -1 4 6 PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END

  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 Amount added to counter variable is specified by keyword STEP Equality in IF condition is specified by equal sign ‘=‘ END IF command is two words

More Related