This month, let us first personalize our program. Clear the screen and ask your student to type his name. The name is ENTERed into a string variable and can be used any place in the program by calling the string variable.
3000 CLS
3005 PRINT AT 10, 4; "<--type your name-->"
3010 INPUT "your name";f$
3050 CLS
3060 PRINT AT 4,8;"Hello, ";f$
-Note- The 2068 lets you enter a prompt in your input statement in line 3010. I will use this format in the future. If you are using a 1000 series just ignore the prompt. Have you given numbering the problems any thought? A variable needs to be assigned and initialized to do our counting for us. Tell the computer where to place the number. Since we need to add 1 to our variable for each problem, let’s start our variable value at 0. We also need a clean screen for each problem.
3040 LET c=0
3350 CLS
3340 PRINT AT 3,2;"No. ";c+1
3370 CLS
This line clears the number with the problem. EDIT line 3380.
3380 PRINT AT 3,2;"No. ";c+1; AT 6,0;x; "+";y;"= ";z
3430 LET c=c+1
The correct answer routine works with the numbering routine and allows us to give the number of correct answers out of a given number. Assign and initialize a variable; decide number of problems to a series and increment the answer number.
3020 LET a=0
3330 IF c=10 THEN GOTO 1200
3440 LET a=a+1
The routine at line 1200 not gives the number correct but reinitializes the variables only also and asks if the student wishes to practice more.
1200 PRINT AT 10,6; "You got" a;" out of ten."
1210 LET c=0
1215 LET a=0
1220 PRINT AT 12,3; "Would you like another play?"
1230 PRINT AT 14,3; "press y or n followed by ENTER"
1240 INPUT "y/n"; b$
1250 CLS
1260 IF b$="y" OR b$="y" THEN GOTO 3070
1280 CLS
1290 PRINT AT 8,5; "Thank you for playing, "; AT 10,5;f$
1300 PAUSE 200
1305 CLS
1310 STOP
You can EDIT the lines to the other parts of the program where they are needed.
Next month we will start on our LOGO. There is a smiley face if the answer is correct and a frowney face if the problem is wrong. Every child of any age that I have used this program with has enjoyed the fast feedback on his or her answers. Some have deliberately answered wrong just to see the frowney face develop.