Numbers

Author(s): Dick Wagner
Publication: The Plotter
Pub Details: The Plotter v11 n1 (Volume 11, Issue 1)
Pages: 4-5

The April 1987 issue of The Plotter carried a short program intended to mathametically determine a number between 1 and 100 that is entered into the program. That program does not work due to errors in the program and errors in the equation used to solve the problem. Odd that this was not reported by somneone until recently when our Jack Armstrong tested it and found it would not work as presented.

As the program was poorly presented it seems best to re-do it in a more understandable form. The user is to input an integer number between 1 and 100. The second input is the operator’s calculation of N/3=A. The third input is the user’s calculation of A/5=B. The fourth input is calculation of B/7=C. Carry the calculation out to four or five places at least and round if desired.

The program uses the equation N=INT(70*C+21*C+15*C) to arrive at the number originally started with.

The inputs can be simplified by using N/3, A/5, and B/7. Once the last input is made the answer is displayed.

  10 PRINT "SELECT AN INTEGER NUMBER 1  TO  100. CALL IT N. MAKE THE FOLLOW-ING CALCULATIONS, CARRIED OUT   AT LEAST 3 PLACES, AND I WILL   TELL YOU THE NUMBER. THE        CALCULATIONS ARE FOR A, B, AND C.": INPUT N: PRINT N
30 PRINT "N/3= A ";: INPUT A: PRINT A
40 PRINT "A/5= B ";: INPUT B: PRINT B
60 PRINT "B/7= C ";: INPUT C: PRINT C
80 LET N=70*C+21*C+15*C
90 FOR Z=1 TO 5
100 IF N>105 THEN LET N=N-105
110 NEXT Z
120 PRINT AT 12,6;"YOUR NUMBER IS ";INT N
125 PRINT
130 PRINT "N=INT (70*C+21*C+15*C)"
140 PRINT "N=INT (70*";C;"+21*";C;"+15*";C;")"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.