computer-assisted instruction in computer programming - collected
TRANSCRIPT
COMPUTER-ASSISTED INSTRUCTIONIN COMPUTER PROGRAMMING: SIMPER,
LOGO, AND BASIC, 1968-1970
by
PAUL LORTON, JR.
University of San Francisco
and
PHYLLIS COLE
Apple CorporationCupertino, Calif.
THIS ARTICLE reports on a program designed to develop computer literacy by offering instruction in a wide range of programming languages.Beginning in 1968, a computer-assisted course in computer programmingwas conducted through the Business Department of Woodrow WilsonHigh School, an "inner city" school in the Hunter's Point-Bayview area ofSan Francisco. Each day for three semesters, between July 1968 and June1970,90 high school juniors and seniors in classes of 15 students interactedwith a course designed to teach the fundamentals of computer programming for business applications. For approximately 50 minutes a day eachstudent was on-line with a computer operated by the Institute for Mathematical Studies in the Social Sciences (IMSSS) on the Stanford Universitycampus 30 miles away.
The program was seen as a way of anticipating the growing demand inbusiness and industry for people able to adapt to computerized operationof jobs. Such tasks as filing and stock-room control, formerly available tominimally trained individuals, would soon require personnel able to seeand solve problems in terms understandable to a computer. Computerliteracy and the ability to use computers would become important for all.
Three courses were constructed in languages that were representative ofthe wide variety of programming languages commonly used at the time.Generally, the main goals of the instruction were to develop computer
The research reported in this article was partially supported by National Science Foundation Grant G] 197 to Stanford University.
841
842 LORTON & COLE
literacy and to present the concept of a digital computer as a tool forsolving problems.
Three computer languages were chosen to represent the domain:SIMPER, an assembly language; (S)LOGO, a symbol-manipulation listprocessing language; and BASIC, an algebraic language. Each language, asa representative of a particular class of programming language, had theadvantages and disadvantages inherent in its class. Each, however, had thecommon advantage of being simply constructed and easy to learn. For theproject the disadvantages of one language were compensated for by theadvantages of the other languages.
The three courses were offered without prerequisite to students in theBusiness Department of Woodrow Wilson High School. As a rule studentsin this department are not "college prep," that is, for them high school isthe last phase in their education. Thus this program, unlike other programs which enrich the education of college-bound students, sought toenrich the education of students who would soon enter the labor market.Much of the design effort for the sequence of courses and exercises in eachcourse concentrated on insuring that limitations in the mathematical orverbal backgrounds of the students would not limit participation in thecourses.
In addition to those students enrolled in the normal high school classesinvolved in the program, several junior high school students participatingin an on-going enrichment program conducted through Woodrow WilsonHigh School took the programming courses in the late afternoons. Adulteducation classes, specially constituted to use the materials developed forthis project, met and interacted with the courses two or three evenings aweek. Thus the project operated 14 hours a day for most of its duration.
The students communicated with a computer at Stanford University byusing standard terminals (Model 33 Teletypes) connected to the computerby telephone lines. A small computer (Digital Equipment Corporation PDP8/1) served as station monitor at the school. The Stanford computer, in itsrole as a teacher, presented instructions and problems to the student bytyping to his terminal. The student responded by typing on the sameterminal. The response was relayed to the computer and analyzed. Afteranalyzing the student's response, the computer replied, correcting thestudent if necessary, and then presented him with additional instruction.At the same time, the computer was handling a large number of otherstudents who might be taking the same course or who might be enrolledin a variety of other courses.
1. LANGUAGES
1.1 Assembly Language SIMPER
SIMPER was an attempt to make available to the student at a terminal asimple computer which he could program in a manner analogous to
COMPUTER PROGRAMMING 843
assembly-language programming on digital computers of modest size. Themain purpose of the SIMPER coucept was to introduce programming ofcomputers at a very low level. SIMPER was developed by Paul Lorton andis extensively documented elsewhere (Lorton, 1971). Table 1 lists the basicoperations for SI MPER.
T ABLE I
SIMPER Instructions
Instruction Purpose
ADD Used for additionSUB Used for subtractionMUL Used for multiplicationDIV Used for division
FIX Places specified number in specified registerLOAD Places contents of specified location
in specified registerSTOR Stores contents of specified register in
in specified register,
CMP Three-way. branching commandJMP Branching command
GET Used to specify input during executionof the program
PUT The PRINT command for numeric valuesCPUT PRINT Character
AND Logical ANDOR Logical ORXCH Exchange registersSHFT Shift register
SOP Special operation
BEGIN Indicates beginning of a programEND Inrlicates end of a programNAME Permits labeling
This instructional package can be most easily understood when viewedasconsisting of two main parts: a machine and an assembler. The latter wasdesigned to generate the machine code for Sf MPER. The "machine" is ahypothetical digital computer which can be described in a formal way(Lorton, 1971) and for which programs can be written. Although themachine responds to IS-bit instructions in its "machine language," there isno direct access to the machine via 18-bit numbers. The purpose of themachine was to teach students to program, so the machine was only instructable through a "programming" language.
844 LORTON & COLE
The assembler for SIMPER was the route by which students couldinstruct the machine. The assembler generates code for SIMPER fromassembly-language instructions typed by the student. Assemblers generatecode instruction by instruction. This one was no different except that itgenerated code for SIMPER immediately after each instruction was typedby the student. This feature enabled the student to receive immediatecorrection on most syntactic errors and it meant that, when the studentavailed himself of the option, each line of code could be checked immediately to assure the student that the assembler translated the student'sinstructions as he wished.
\.2 Symbol Manipulation/List Processing Language (S)LOGO
Stanford LOGO was adapted from the symbol manipulation languageLOGO developed at Bolt, Beranek and Newman by Feurizig and Papert(1968). The language was designed expressly for teaching principles ofcomputer programming. The Stanford version was developed by JohnSlimick and is extensively documented (Slimiek, 1971).
(S)LOGO is a language designed to operate on words and sentencesrather than on numbers as is the case with algebraically oriented languages.The use of such languages in teaching about computers enlarges theconcept of a computer from a number handler to a symbol manipulator.Thus conceived, a computer· can be a more powerful tool. Table 2 lists theinstructions implemented in the Stanford version of LOGO.
\.3 Algebraic Language BASIC
Beginners All Purpose Symbolic Instruction Code (BASIC) is a programming language designed for algebraic applications. I t was developedby Kemeny and Kurtz (1967) at Dartmouth College to be an easily learnedlanguage.
BASIC is a problem solving language suitable for applications in thescientific, business, and educational areas. It can- be used to solve problemsthat are both difficult and complex. It is one of the simplest programminglanguages-only a small number of clearly understandable and readil ylearned commands are required to use it. Since BASIC is usually implemented in timesharing environments and available through terminals,learning the language in an interactive environment would be quite appropriate to later uses in an interactive environment.
The version used in this project was provided with the Digital Equipment Corporation PDP-IO Timesharing system. The BASIC instructionstaught are listed in Table 3.
2. CURRICULA
2.1 Introduction-Fundamental Programming Concepts
For all three courses, the main curriculum structure consisted of corelessons, homework assignments, and tests. Each core lesson had a dittoed
Command
AND
BUTFIRST
BUTLAST
CALLDIFFERENCEENDFIRST
GOIFLAST
NUMBEROF
PRINTQUOTIENTRETURNSENTENCESENTENCE?SUMTIMESTOTRACE
UNTRACEWORDWORD?
COMPUTER PROGRAMMING
TABLE 2
(S)LOGO Commands
Purpose
Pseudo-command, used as in English;helps separate parts of instruction
Gives all but first character of a word,or all but first word of a sentence
Gives all but last character of a word,or all but last word of a sentence
Used to name things CALL ''JULY 8" "MY BIRTHDAY"Used for subtractionsIndicates end of a procedureGives first character of a word, or first word
of a sentenceBranching instructionConditional instructionGives last character of a word, or last word'of a sentence
Tests to see ifinput is a numberPseudo-command, used to separate an instruction
from its first argumentCauses specified information to be typedUsed for divisionGives the specified value as the value of a procedureCreates a sentence from two argumentsTests to see if input is a sentenceUsed for additionUsed for multiplicationUsed to define a procedurePrints out values of variables each time they occur
in a procedureStops TRACECreates a word from two argumentsTests to see if input is a word
845
homework assignment associated with it. For about every five lessons a testwas available. Homework and tests were assigned as desired by the classroom teacher; they were mainly corrected by the computer although theteacher needed to check computer programs.
A student manual was prepared for each course. The manuals typicallyincluded a brief discussion of computers, a description of the instructionalprogram and how to use it, a description of the programming languagebeing taught, an outline of the course, a discussion of grading, a glossary,and a list of special symbols and characters used in the course.
Each class of students was supervised by a teacher, who had little if anyprogramming experience. Brief courses in SIMPER and (S)LOGO werepresented to the teachers before the first use of the courses at WoodrowWilson High School. In addition to this class, teachers became familiar withthe materials by working through lessons as students. Close contact was
846
Command
DATADEFENDFNEND
FOR .. TOGOTOGOSUB
IF ...THENINPUTLETNEXTPRINTREADREMRETURN
SQR(X)STEP
LORTON & COLE
TABLE 3
BASIC Commands
Purpose
Indicates data for programUsed to define formulas or functionsSpecifies end of a programSpecifies end of function that is
more than one line longSpecifies the beginning of a loopBranch commandBranches to a subroutine and
returns to the correct location in the programafter the subroutine is performed
Conditional commandAllows input during execution of a programAssigns values to variablesSpecifies end of a FOR loopCauses specified information to be typedIndicates data to be read from a DATA liarPermits a comments within a programBranches subroutine back to the correct place
in the main programGives the square root of XSpecifies step size in a FOR loop
maintained with the Institute (IMSSS) both by telephone and through visitsby personnel to the school. A teacher's manual was available as a referencefor each course; it typically contained a copy of the student manual, a copyof each homework assignmerit. answers to homework and tests, and discussion of possible student problems.
Good computer programming, under the philosophy advanced by thisproject, depends on understanding certain programming concepts notparticularly oriented toward anyone machine or language. The basicconcepts necessary for understanding the kind of applications programming taught in this project include concepts that are related to making astored-program machine work for the user, concepts that are related tosymbol-manipulation list-processing, and concepts that are related to thetranslation of algebraic procedures into the machine.
The following list contains the concepts that form the basic content forthe three courses.
Stored Program. A set of instructions contained in a computer and available tothe machine for execution in some predetermined, sequential fashion. Thisconcept is best introduced at the assembly language level.
Stored Data. Any set of stored numbers. They are not required to have structureor meaning. Stored programs are one type of data. This concept is best introduced at the assembly language level and amplified through the data declarationstatements employed by higher level languages.
COMPUTER PROGRAMMING 847
Variable. The name given to some part of the stored program. The variablename permits reference to an alphanumeric quantity or to a portion of aprogram. This concept is best introduced in assembly language programmingand illustrated with increasing abstraction by its use in algebraic and symbolmanipulation-list processing languages.
Operations. Capabilities' contained in the Central Processing Unit. Two mainclasses of operations,are important: arithmetic and non-arithmetic. The clearestexamples of the distinctions between these operations as well as the most basicpresentation of their "machine level" functioning is through assembly languageprogramming.
Addressing. The process of pointing to various parts of the stored program aswell as the ability to form data into clusters or arrays in some useful way. Threesubconcepts are important: indexing, base addressing, and indirect addressing.Assembly language programming gives the most basic introduction to thisconcept while the higher level languages illustrate its function at a more abstractlevel.
Branching. The ability of a stored program to reorder the sequence of events itperforms in completing a task. Algebraic languages most clearly illustrate thefunctional use of this concept while assembly language programming introduceshow it is accomplished by a computer.
Loops. Portions of a program that confer the ability to re~execute a subsequenceof the program in order to complete a repetitive task. Both algebraic and symbolmanipulation-list processing languages illustrate this function in slightly different ways.
Formula Translation. The process the machine, properly instructed, uses toexecute a mathematical or logical "formula." Algebraic languages most easilyintroduce this concept while symbol manipulation-list processing languages arebest for illustrating its power.
Blocks/SubprogramslProcedures. These, with minor differences, are subgroupings of the stored task which form semi self-contained programs oftencapable of being introduced into the main event sequence by being "called."Algebraic languages most clearly introduce this function while symbol manipulation-list processing languages illustrate their operation at a more abstract level.
Input/Output. The machine's methods for listening and talking to the user.Algebraic languages best illustrate simple levels of the use of this concept.
Debugging. The complex of mysterious behaviors needed to cure problems in astored program. All languages are useful in teaching this concept but simpleassembly language programs are useful for introducing it.
Data Handling. The method of viewing and manipulating the data a programhandles. At increasing levels of abstraction the assembly language, algebraic andsymbol manipulation-list processing programming illustrate how this is accomplished.
Recursion. A self-calling ability of subblocks of the program. Symbol manipulation-list processing languages· best convey this concept.
Arrays and Strings. General and efficient ways of clustering stored data so thattheir manipulation becomes a simpler task. Algebraic and symbol manipulation-list processing languages can be used to demonstrate this idea.
Data Structures. Named functions which use indexing and pointers to locateelements in the stored data. Examples are trees, lists, graphs, etc. Symbolmanipulation-list processing languages provide suitable illustrations of this area.
848 LORTON & COLE
From the above information it is apparent that each of the three classesof languages is most suited to introducing, illustrating or amplifying acertain set of these basic concepts. Since the goal was to teach the conceptsin general and not some specific programming language, an instructionalsequence was built from simple representatives of each class of language.
2.2 Instructional Strategws
In addition to"the specific programming concepts that were contained inthe course content, the structure of each course embodied two mainpedagogical goals of providing both individualization and a learning environment in which students would develop techniques for self-evaluation.Particular attention was given to providing sufficient remedial work, practice, and review for less able students. Students were encouraged toevaluate their own progress to determine when such remedial work wasneeded.
Each curriculum provided individualized instruction by the use of threeresponse modes: multiple choice, constructed responses (where a studenttypes a word, numeral, or phrase), and programs. Errors in multiple choiceand constructed response problems are reported by the instructional program. When writing programs, the student is in direct communication withthe interpreter for the programming language he is learning, and errorsare reported by the interpreter.
Although the instructional systems provided effective remedial instruction by analyzing student responses in detail and responding differentially,this scheme alone was not thought sufficient to accommodate the studentwho is aware that he cannot give the correct response, and would prefermore instruction before attempting an answer. Three student controlcommands were available to further individualize each course while encouraging self-evaluation by the student.
The HINT control command allowed the student to access additionalinstruction at any time during the working of a problem by typing a specialstudent control key. Since some students learn well with much less detailedinstruction than others, the scheme of including optional instruction witheach problem allowed the brighter student to move rapidly through thelessons while providing sufficient instruction for the less able (or moreinsecure) student.
The ANSWER control command was available to the student at anytime. About 75 percent of the problems in the course contained the text ofthe correct answer, which was displayed whenever the student typed theANSWER control key. Often the older student can learn if he is shown thecorrect answer, rather than being required to construct a response. Pastexperience with this kind of device indicated that the older student doesnot tend to "abuse" such a privilege; in fact an ANSWER command is usedquite infrequently.
COMPUTER PROGRAMMING 849
The GO control command allows the student to partially determine thesequence of materials by changing lessons, perhaps to skip back and reviewa lesson. This command was also used by the student to access homeworkassignments and tests.
Each of the three courses was approximately one semester in length forthe average high school student with a good command of sixth-gradearithmetic skills. However a more able student, or one who had beenexposed to programming concepts before might complete a course in halfthe time by not requiring remedial work or review sessions and by takingadvantage of omitting optional practice sessions. A slow student, taking fulladvantage of remedial and review materials, might take more than onesemester to complete a course.
In each course elements of the programming language are taughtlargely by examples in context, immediately followed by sequences ofpractice problems designed to create an awareness of the possibilities andlimitations of each language element. The student is permitted to make anynumber of tries per problem in the core lessons of each course. It wasstressed that wrong answers while learning were not part of the grade~
Only on the homework assignments and tests were trials-per-problemlimited and results made available to the teacher.
2.3 SIMPER
SIMPER is an assembly-type language designed for instructional purposes and contains the instructions listed in Table 1. Thecourse consistedof 38 lessons outlined in Table 4 which most students followed in sequence.Review was an inherent part of the structure of each lesson; additionally,four special review lessons were included in the course.
Remedial help was available to students through the HINT and GOcommands which allow a student to obtain optional material or reviewlessons at his discretion. Those students who needed more practice thanaverage were able to use the four review lessons as well as the "SolvingProblems" lessons to good advantage. Superior students were encouragedto omit these lessons.
Before beginning, the course, the student in the classroom learned howto sign on and off the computer. Starting with the the basic concept of astored program machine the lessons introduced the SIMPER instructionsthat could be used to store literal values in the machine's memory. The nextstep in the instruction was to explore the basic arithmetic operations of themachine covering addition, subtraction, multiplication, and division.
Following coverage of the basic concepts of Stored Programs, StoredData, Addressing, and Operations, the lessons covered simple inpu t andoutput of numerical information. Then lessons on branching and loopingrounded out the SIMPER curriculum.
850
Lesson
101102103104105106107108109
110
III
112113
114
115
116117118
119
120
121122123124125126127128129130131132133
134135136
137138
LORTON & COLE
TABLE 4
Outline of Lessons for SIMPER
Description
IntroductionFIX, STOR: introduces these 2 SIMPER instructionsBEGIN, END, PUT: more new instructionsPractice: on instructions so farADDLOADMUL, SUB, DIV: more instructions to do arithmeticPractice: emphasis on instructions for doing arithmeticSigning on to SIMPER: learning to write programs directly
in the language; how to debug a SIMPER programGET: the instruction that lets you type in input
while executing a programProblem solving: \vriting programs to solve word problems
for youNegative numbers: using GET to input negative numbersTwo operations: using more than 1 arithmetic instruction
in a programReviewing instructions: control commands and instructions
are both reviewedChoosing programs: looking at different ways of doing
the same thingPractice: especially in writing SIMPER programsRegister BRemainders: when you divide a number in register A,
the remainder is stored in register BComparing numbers: given two numbers x and y, is x less than,
equal to, or greater than y?CMP: the SIMPER instruction used to compare numbers,
and how it worksPractice: emphasis on CMP, division problems with remaindersIntroducing JMP: skipping within a programMore about JMPSolving Problems: deciding what certain programs doPractice: emphasis on JMPJMP and 0: how to make sure a JMP will always workReviewIntroducing NAME: how to label locationsMore About NameDivisibility: seeing if a number is divisible by 2, 3, etc.Practice: emphasis on NAME, divisibilityReviewIntroducing Counters: having your program check
how many times you've done an operationLoops: using a counterPractice: emphasis on loopsSolving problems: writing programs involving loops
to solve problemsPractice: emphasis on loopsReview
COMPUTER PROGRAMMING 851
SIMPER has a feature that makes it particularly useful for demonstrating how a program works: the contents of the location counter and twogeneral-purpose registers (used for performing operations) are printed outas each step is executed. This instruction-by-instruction execution of aprogram allows the student to monitor execution of his programs, givinginsight into how each instruction operates and how a sequence of instructions can be converted into meaningful work. The feature also makesdebugging programs an easier task. Faster execution may be gained byusing a special command to suspend the instruction-by-instruction printoutfeature.
2.4 (S)LOGO
The curriculum for (S)LOGO, while it was independent of the SIMPERcurriculum, built on the concepts taught in the first phase of the project.(S)LOGO is a list-processing language and as such is suitable for manipulating alphanumeric strings of data as well as for doing straightforwardarithmetic. The course consisted of the 48 lessons outlined in Table 5 andinvolves the instructions in Table 2.
Those elementary (S)LOGO commands which allow simple string building and manipulation were introduced first. Instructions used in namingand building blocks of statements were then presented. Various tests usedfor branching in a string-oriented language were taught leading finally tolessons in functions and recursive functions.
Most of the comments made about the SIMPER course apply to the(S)LOGO course: homework and tests are handled in the same way. Anattempt was made to provide more lessons suitable for review and extrapractice, particularly for less able students. The general pattern was fourlessons of new material followed by two review lessons, the second of whichwas usually a cumulative review.
One of the powerful features of (S)LOGO is the ability to write recursivefunctions. The course included an ll-lesson sequence designed to introduce and explore recursive functions.
2.5 BASIC
The curriculum developed for BASIC emphasized the concepts mosteasily explored through an algebraic language. The BASIC course is designed to allow substantial student control. Within the course there arehundreds bf decisions points at which the student is asked to make astatement of preference. Most of the decisions to be made by the studentconcern the use of optional material such as detailed summaries, reviewguides, and self-tests.
The 50 lessons outlined in Table 6 cover the instructions listed inTable 3. The lessons vary in length from 20 to 40 problems and requirebetween one and two hours for an average student to complete. The main
852 LORTON & COLE
TABLE 5
Outline of Lessons for (S)LOGO
Lesson Description
1 The Instructional Program2 Introducing LOGO; PRINT3 WORD; SENTENCE4 FIRST; BUTFIRST5 Review of Lessons 2-46 Review of Lesson 17 LAST; BUTLAST8 Introducing Compound Instructions9 Compound Instructions
10 Signing on to LOGO11 Review of Lessons 7-1012 Review of Lessons 2-1013 Arithmetic· Instructions14 Negative Numbers15 The CALL Command16 CALL and Compound Instructions17 Review of Lessons 13 and 1418 Review of Lessons 15 and 1619 The SAME? Command20 WORD?; NUMBER?; SENTENCE?21 GTR? AND Compound Commands22 Functions23 Review of LOGO Test Instructions24 Review of Functions25 Editing Functions26 Functions with more than I Argument27 The GO TO Command28 Choosing Functions29 Review of Lessons 25-2830 Review of Lessons 1-'2931 An Astrological Function32 Introducing Recursive Functions33 Writing Recursive Functions34 Hide and Seek35 Review of Lessons 31-3436 Review of Lessons 1-3537 Figlatin38 More Recursive Functions39 Solving Problems40 Sets41 Review of Recursion42 Review of Lessons 1-4143 Money44 The BOTH Command45 The EITHER Command46 Loops47 Counters48 Review of Lessons 43-47
Lesson
I23456789
101I121314151617181920212223242526272829303132333435363738394041424344454647484950
COMPUTER PROGRAMMING
TABLE 6
Outline of Lessons for BASI C
Description
Introduction to the instructional programUsing BASIC to do arithmeticSolving word problems involving one operationParentheses; order of operationsSolving word problems involving more than one operationSelf-testOverviewDecimals; some techniques of debuggingMore about debuggingThe LET command; introducing variables'The INPUT commandThe GO TO commandSelf~test
OverviewComparing numbersThe command IF . : . THENMore about PRINTUsing two countersTracesSelf-test
OverviewThe commands FOR, TO, and NEXTSTEPSolving problemsLoops with variable boundsLoops with INPUT or IF instructionsSelf-testOverviewThe READ and DATA commandsSolving problemsIntroducing exponentsThe SQR commandThe DEF commandSelf-testOverviewNeat outputPatternsThe STOP and REM commandsThe GOSUB and RETURN commandsEquivalent programsSelf-testOvenriewScientific notationProblems involving scientific notationIntroducing nested loopsUsing nested loops"Realistic" programsSelf-testOvenriewHow to learn more about BASIC
853
854 LORTON & COLE
strand of the course consists of five core lessons; each core lesson presents anew concept. Associated with each core lesson is an optional summary ofthe lesson; the summary is typed in a standard notebook sized formatwhich the student could save as a permanent reference.
An optional self-test designed to help the student evaluate his understanding of the concepts presented to date could be taken after each groupof five core lessons. Since this test is available for student use and not forgrading purposes, no report on student performance is available to theteacher. The self-test is followed by a general overview lesson that remindsthe student what has been taught and which of the topics covered areessential to the subsequent material. The overview lesson is prepared as aone page guide that assists the stu~ent in locating any material he may needto review.
After the student has taken the self-test and been given the opportunityto review, he is given a short graded test, which is evaluated partly by thecomputer and partly by the supervising teacher. The graded tests areencountered every week or ten days, depending upon how fast the studentprogresses in the course.
When a student attempts to write a program in SIMPER, (S)LOGO, orBASIC he interacts directly with the appropriate interpreter, so he nolonger has access to the hints, wrong-answer messages, etc., available via theinstructional system. When writing a program, the student must rely on theerror messages available from the interpreter, and often such messages arenot sufficient help to a student who lacks a clear understanding of what isbeing asked of him. The BASIC curriculum has three main ways aroundthis problem.
The first approach is to make several hints available with each problem.The first time the student types the HINT key he receives the first message;the second time he receives the second message, etc.
The second approach involves looking for particular wrong answers toquestions regarding output of a program or a proposed plan for a program. Usually, wrong answers are corrected by a single message. In somecases, an expected wrong answer may indicate a need for more extensiveinstruction. The student is branched immediately to a series of remedialproblems designed specifically to correct the misconception identified withthat particular wrong answer. The remedial sequence may contain fromone to twenty problems; such a sequence is provided at every critical pointin the curriculum. Approximately 250 such remedial sequences are incorporated into the core lessons, usually in association with problems assigningthe student to write a program.
The third approach allows the student himself to initiate the remedialsequence by typing HELP after a programming problem is assigned.
COMPUTER PROGRAMMING
3. CURRICULA DELIVERY SYSTEM
855
This project used the full facilities of the IMSSS Computer-BasedLaboratory. Instructional material was presented via both the DigitalEquipment Corporation PDP-l and PDP-IO computers at the Institute.Each of the machines presented slightly different problems and advantagesfor the program but, in general, the solutions were machine independent.The implementation of the project on each machine involved developing a"curriculum supervisor" to present the lesson material and evaluate student responses, and developing linkage to the language processor involved.
Both the PDP-l and PDP-1O communicated with the terminals at thehigh school through a PDP-8I located on site and used as a terminal lineconcentrator.
For the SIMPERJ(S)LOGO portion of the project the PDP-l System wasused. For the BASIC portion, the PDP-1O System was used. The timesharing system and the curriculum supervisor used is described below, firstfor the PDP-l and then for the PDP-IO.
3.1 PDP-l Timesharing System
The main computer used in the SIMPERJ(S)LOGO phase of the projectwas a Digital Equipment Corporation Programmed Data Processor-ID.The PDP-lD is a single address, 18-bit binary machine. The machine has32,768 words of core memory of which 20,480 words are used by the"timesharing" operating system. User programs are permitted up to 12,288words of core. The time-sharing system allows up to 26 "users" to run onthe computer at the same time. This is made possible by the addition to thePDP-l of a very high speed drum with 26 tracks, each capable of holding a4,096 word program. The timesharing system trades these programs inand out of core memory thereby greatly increasing the flexibility of thebasic machine. The operation of the PDP-I timesharing system necessitatesdeveloping instructional programs which micro time-share. That is, each ofthe programs in the SIMPERJ(S)LOGO portion of the project was designedto run a number (16) of terminals by itself. The programs in this projectoccupied 10 of the 26 available drum tracks.
3.2 SLAKER: The PDP-l Curriculum Supervisor
SLAKER, the instructional system developed for the SIMPERJ(S)LOGOphase of the project, was designed to provide the interface between thestudent at a terminal and the curriculum material of the project. Theover-riding concern in the development of this driver was to provide asmuch freedom and flexibility for each user as possible within the constraints imposed by '!micro-timesharing" among all the users.
856 LORTON & COLE
If a student's program would cause a real machine to enter an infiniteloop or write over his data then this should happen to him in the instructional setting. Certain obvious restrictions have been placed on this goal. Astudent's work was not free to interfere with other users (although thismight well happen on a "real" machine) because this is not an especiallyuseful experience for the other students. A student could "wipe out" hisown effort and, to a degree, experience the pain of having to recover fromthe error.
The major functions SLAKER performed included Text Delivery, Response Evaluation, Communication with the Language Interpreters, andSpecial Requests.
Text delivery. One of the major tasks of SLAKER is the presentation ofproblems to the student at his terminal. Several of the disk files attached tothe driving program contain the "curriculum material" which is organizedinto four "strands" (sequences of lessons and problems through which thestudent is to proceed). In addition to the lesson text, the problem codecontains certain values which indicate various subsections of the problem,such as the "correct answer" or the "hint."
The four strands into which lessons and problems are grouped for thisproject are: Lesson, Homework, Extra Credit, and Test: For problems inthe Lesson strand SLAKER is charged with waiting until the student entersthe correct answer before going on to" the next problem. With the otherthree strands SLAKER presents the next problem as soon as any answer isentered. In every case the student is informed of the correctness of hisanswer.
Response evaluation. After transmitting problem-stating text to theuser, SLAKER monitors his input, collecting it as an answer to the posedproblem. When the user enters an "evaluate my work" request, SLAKERchecks his answer according to the scheme indicated by the typeofproblemthe student was given:
1. Multiple Choice. Under this format the answer is first compressed so that allduplicate characters are eliminated. Then the answer is searched for matcheswith the characters recorded as the correct answer. Up to twenty charactersare collected from the student as possible answers for problems stated in thisformat. Only alphabetic (alpha) characters are collected so that spaces, punctuation marks, even numbers can be inserted in the answers without affectingthe correctness of the alpha string.
2. Constructed Response. When the student's input is in answer to this type ofproblem all the characters he types, with the exception of carriage returnsand line feeds, are collected. The checking routine· then examines the answerstring looking for two kinds of characters: those that must be present andthose designated as optional. The search and match routine is of suchgenerality that, it is felt, all possible correct answers will be marked correct ifthey are defined in the criterion string.
COMPUTER PROGRAMMING 857
3. Anticipated Alternative. Although not a separate type of problem, this checking capacity is a separate skill of SLAKER. If alternative answers are expected they can be specified and checked for. If a correct answer is not foundthen the answer evaluation routine checks the student's effort, in the samefashion, against the strings specified as possible alternatives. If a match isfound then an appropriate comment is given and the student is told to tryagain just as is the case when he is wrong. At present this capability isavailable on constructed response problems and single answer M/C prob~
lems.
4. Programming Problems. At present, evaluation of these problems is done byasking the user questions about his program after it ran. An eventual capability could be to process the programs written through an "equivalencechecker" which would see whether or not the student's program met variouscriteria specified for a correct response. Some work is presently consideringthis problem and, in the saved SIMPER programs of the students, thereexists the potential data for such an evaluative scheme. The current thoughtis that some "elegant" combination of the "constructed response" and "anticipated alternative" checking schemes will suffice for checking the equivalence of SIMPER programs.
Communication with language interpreters. Since the main aim of thecourse is to provide rich and varied experience in programming, a mainresponsibility of SLAKER is to readily provide this contact. Each languagediffers slightly in how it wants to be told a student is using it but basicallySLAKER's role is to make the initial contact with the language processor,pass subsequent information to it, and await the user's indicated wish toreturn to the main program.
Special requests, The following activities could be requested from astudent station. As a group they provide the student with considerableflexibility in how he proceeds through the course.
1. Restart Terminal. Allows a user to request a terminal be restarted from thesign~on point. Used to correct improper sign-on efforts by students.
2. Sign-Off Terminal. Allows a user to terminate his lesson when he is ready.Part of the execution of this command involves storing where the student leftoff on his history file so that he may restart from this point on the followingday.
3. Go to Choice Point. Places the user at a point where one of the followingchoices can be made:a. Return to Last Problem. Allows the student to continue working fromwhere he last signed-off in the strand he specifies.b. Go to Specific Lesson. Allows the student to begin working on the lessonnumber in the strand he indicates.c. Attach a Language Processor. Allows the student to call forth one of thelanguage processors available in the course.
4. Skip Problem. In the Lesson strand, only a correct answer will advance astudent on to the next problem. This feature allows a student to skip out ofthis loop. As the next problem is called, the correct answer to the skippedproblem is printed.
858 LORTON & COLE
5. Give Hint. Commands SLAKER to print the "hint" provided for the particular problem.
6. Erase Answer. The user has the option of erasing all of the answer he hastyped or merely the last character. Erasing the last character can be repeateduntil the entire answer is erased if wished.
7. Communicate with Stanford Monitor. This feature allows student stations totype messages to the monitor terminal at Stanford. Usually its use is reservedfor the classroom teachers who may want to correct a lesson, enter a new~tudent, or ask a question. As part of this feature it is also possible tocommunicate from the monitor terminal to anr of the student stations.
Further details of this curriculum delivery system are developed in Slimickand Lorton (1971).
3.3 PDP-10 Timesharing System
The central processor in the BASIC phase of the project was a DECPDP-10. The Time Sharing monitor on this computer operates hy allocating each user a certain area in the 256,000 words of core memory it has atits disposal and then rotating the running time in the processor among theusers in core. The monitor also has the capability of segmenting a user'sprogram into a "shared" (purely executahle read-only code) and unsharedportion. This means that many users can be served by a single programwithout the necessity of that program itself sorting out the input andoutput in order to share its time. Thus many users can have access to theBASIC language processor or the curriculum supervisor without the arbitrary limitation imposed by the less flexible PDP-1 timesharing system.
The number of possible users on the PDP-lO system at the time of thisproject was 128.
3.4 INSTRUCT
The coding language INSTRUCT is a high-level programming language designed for programming computer-assisted instruction. The language was developed by Jamesine Friend and is extensively documentedelsewhere (Friend, 1971).
The setaf instructions available to the lesson author and that will begiven to the computer about how to present a lesson to students include:
1. what exercises to type and when to wait for an answer.
2. how to analyze the student's answer to determine whether or not it is correct.
3. how to respond to the different possible answers a student may give.
4. what exercise to present next.
These instructions to the computer must be written in a language thecomputer understands, and INSTRUCT is one such programming language. After the instructions are written, they are entered into computermemory where they are stored until some student needs them. The studenttakes the lesson by using a computer program called 1NST which interprets
COMPUTER PROGRAMMING 859
the language INSTRUCT into machine language so that the computer canoperate. The lessons are grouped into "courses" in computer storage.
Each course consists of a number of strands and contains a number oflessons. Each lesson consists of a series of exercises, written in the languageINSTRUCT. In addition to interpreting the coded lessons, the programINST also keeps track of which students are enrolled for which courses,how far each student has progressed, and how well he is doing.
A number of optional features included in the INST program allow thestudent to request the correct answer to an exercise or allow him to doexercises in any order he wishes. Which optional features are used dependsupon the "course type," and each course is identified as one of six possibletypes. Some course types give the student control over his own sequence ofexercises, others allow him to request additional instruction before heresponds to an exercise. Some permit an unlimited number of trials oneach exercise, while still others restrict the number of allowable trials, etc.In addition to the content of certain "standard messages," the course typedetermines what characters are designated as "student control keys." Forexample, one student control key is the "tell" key; the student types theCTRL key and the letter G simultaneously or he types a slash (I) to get theanswer. The end of a response may also be indicated by typing an "enter"character; in one course type the "enter" character may be the RETURNkey; in another it may be a space or a period.
A lesson is coded by using a series of commands or instructions thatcause the computer to present problems, via teletype, to students. Forexample, commands cause a problem statement to be typed; commandscause student answers to be analyzed (checked for correctness); commandscause specified messages to be typed if the student is correct, etc.
Each command must begin with an "op code" followed by a space. Opcodes, the vocabulary of the coding language, are mnemonic words, such asEXER, HINT, and EQ, and serve to specify the kind of command. EXER,for example, is the op code for a command that causes an exercise to bedisplayed. Of course, the text for the exercise must also be supplied by thecoder, so an EXER op code is followed by a text string containing the textof the problem. The text must be enclosed in text delimiters, such as + or t.These text delimiters serve as "quotation marks"-in fa<;:t, quotation marksmay be used as text delimiters.
EXER + WHAT IS THE SUM OF 15 AND 12? +
The above command causes the computer to type the following on thestudent's teletype:
WHAT IS THE SUM OF 15 AND 12?
and then to wait for a response from the student.
860 LORTON & COLE
As another example, an EQ command is used to find out if the student'sanswer is equal to a certain number. The command
EQ/3.1416/
causes the teaching program to check the student response, which must beequal to 3.1416 in order to be correct.
The correct answer command
CA "GOOD THINKING"
types on a student's teletype if he makes a correct answer.The commands for problem coding are of four kinds: Problem State
ment Commands, Analysis Commands, Action Commands, and Miscellaneous Commands.
Problem Statement Commands. The problem statement commandscause either a display of the problem statement or a display of additionalinstruction or information about the problem and must be the first com':'mand in a problem. The op codes for problem statement commands areEXER, LEXER, NEXER, and SEXER.
Analysis Commands. Analysis commands cause a student's response tobe analyzed to determine whether it is correct. The analysis op codes are:
EXACT / NOTEXACTMC / NOTMC (MC means "multiple choice")EQ / NOTEQ (EQ means "equal number")KW / NOTKW (KW means "key word")YES / NOTRUE / FALSE
Action Commands. Since the analysis commands ordinarily give thestudent no visible indication of whether his answer is correct, a third type ofcommand is needed. The "action command" tells the student the result ofthe analysis of his answer.
Some action commands are specifically for correct answers or wronganswers. These are:
CA / WA (C means "correct", W means "wrong")CI / WIC2/ W2C3/ W3BRCA / BRWA (BRCA means "BRanch if Correct Answer")WS (WS means "Wrong but Skip to next problem")WR (WR means "Wrong. Retype exercise")
Miscellaneous Commands. Besides the commands used in coding aproblem (problem statement commands, analysis commands, action commands), the coding language also contains several miscellaneous commands:
LESSONEOLTYPEJMPGEJMPLDEFINECOMMENTCRUNCHNEXT
COMPUTER PROGRAMMING 861
The two most important of these are LESSON and EOL. The LESSONcommand is the first command in a lesson and serves to identify the lessonby strand and by number like this:
LESSON T,5
The EOL (End of Lesson) command is the last command in a lesson.
4. PERFORMANCE
Student performance in the courses will be considered from three pointsof view: who used the course, did performance improve on a measurabledimension, and what did actual student output look like. The main goal ofthis project was curriculum development and funds for data collectionwere limited.
4.1 Curriculum Usage
The three courses developed were in use for a total of three schoolsemesters under NSF funding. The SIMPER and (S)LOGO courses wereused from February 1969 through June 1969 and again during the semester from September 1969 through January 1970. During both semestersthe entire SIMPER course was available. During the first semester only 20(S)LOGO lessons were available; all 48 (S)LOGO lessons were available thesecond semester. As of February 1970 the Institute has used the PDP-I0computer for the major portion of its CAl work. The SIMPER and(S)LOGO courses, available on the PDP-l computer, have not been available to students since that time. The BASIC course was used from February 1970 through June 1970.
In each course offered, at least one student was able to finish all availablelessons. The minimum number of lessons completed varied greatly: oftenif space was found a student was transferred into the course even though itwas nearly over. Thus a transfer student arriving towards the end of asemester could, in a programming course, enter the class without holdingthe class back or feeling behind.
Table 7 shows the number of students who used each course. Unlessotherwise indicated, all students attended classes at Woodrow Wilson HighSchool in San Francisco. Students in Grades 4-6 attended a special after-
862 LORTON & COLE
TABLE 7
Student Enrollment
CourseJr. & $r.
Grades 4--6 AdultsHigh School
SIMPER, (S)LOGO 93 12 27Feb.-June 1969
SIMPER, (S)LOGO 121 15 32Sept. 1969-Jan. 1970
BASIC 112 25 24Feb.-June 1970 8"
a Employees at the Stanford Medical Center.
school enrichment program; adults were enrolled in an adult educationprogram.
Although the NSF grant terminated on July 1, 1970, the BASIC coursecontinued to be used. Funding was found to run 32 Upward Boundstudents in the Watts area of Los Angeles during the summer of 1970. TheMedical Center employees continued to use the course through January1971. During the' 1970-1971 school year, 17 students, 13 of them deaf, usedthe BASIC course in conjunction with other IMSSS projects. No fundingwas found to continue the project at Wilson High, despite concerted effortsby personnel, students, and parents of students interested in the courses.
4.2 Stutknt Performance
Because of the lack of funds for such efforts, it was not possible todevelop tests of programming achievement separate from the CAl courses.Thus, the tools for evaluatingstudent progress were limited. One performance measure that was economical to obtain and which might possiblyshow some change was level of arithmetic skills. Therefore, two groups ofstudents were given the Computation and Applications sections of themathematics portion of the Advanced form of the Stanford AchievementTest (SAT). The "experimental group" consisted of students using the CAlcourses; the "control" group was a comparable group of students chosenfrom the Business Mathematics classes.
The pretest was administered on March 12, 1970 and. the posttest onJune 6, 197.0. Pretest and posttest data were available for 39 experimentalstudents on both sections of the test, for 20 control students on the Computation section, and for 19 control students on the Applications section. Thegrade placement scores for both groups of students on the pretest and theposttest are shown in Table 8.
COMPUTER PROGRAMMING
TABLE 8
Average Grade-placement Scoreson the Stanford Achievement Test
SectionPretest Posttest
of testExperimental Control Experimental Control
Computation 8.08(39)' 7.73(20) 9.1 I 8.23
Applications 7.7 (39) 8.25(19) 8.61 8.27
a Numbers in parentheses indicate number of students.
863
As expected, because of the short duration of the treatment (threemonths between pretest and posttest) and the peripheral nature of the testto the CAL curriculum, no significant differences were found between thetwo groups. Nonetheless, it is interesting that experimental group showed again in average grade placement of about one year, in comparison to anexpected gain for that time period of .3 year.
4.3 Student Interaction
Appendices A, B, and C illustrate the interaction of a student with eachof the courses constructed for this project. The support of the student'slearning effort at a terminal is clearly illustrated. Especially in the SIMPERsection, the ability to program and interact with the curriculum allows thestudent to build skills in a careful and systematic fashion. This facility wasavailable in varying degrees for all three languages and provided much ofthe instructional effectiveness of the project.
5. CONCLUSION
In comments by the teachers, the over-all formulation of the project andthe specific implementation of the language processors and curriculumpackages were well received and the teachers found the computer-assistedinstruction format useful in meeting their instructional needs.
Teaching a sequence of languages to illustrate all the basic concepts incomputer programming was received as a conceptually sound and reasonable procedure by the teachers. However, additional curriculum material,perhaps an additional semester course, would be needed to explicitlyexplore and emphasize the comparative aspects of the three classes ofprogramming languages. The present courses, partly due to the structureof traditional high school curriculum and course requirements, were toodiscrete.
864 LORTON & COLE
The reaction of the teachers to the project was posItive. They mademany helpful suggestions which were used to improve and upgrade thematerials throughout the courses. An even closer coordination withteachers and a more rapid implementation of their suggestions wouldimprove the liaison between the school and research facility for a projectsuch as this.
In general the students had positive reaCtions to the CAL experience.They had minor objections to problems containing long text passages thatwere typed out by the computer, since the typing rate of the terminals wasmuch slower than the students' reading rate. Placing long text passages offline (as was done with homework assignments) either through a printedpage or a microfiche projector, would answer this problem.
The SIMPER course was commented on favorably by both students andteachers, but several changes were suggested. For example, the teachersfelt that the student should learn to use the interpreter in an earlier lesson,to provide a greater experiential base in writing, debugging, and runningprograms. Additional remedial work for less able students was alsosuggested. The curriculum should also attempt to give the student a clearerunderstanding of the distinction between the instructional system, whichpresents the lessons about a programming language, and the interpreter,or the language itself, in which the students write programs directly.Finally, the teachers suggested new names for certain commands, and alsosuggested that simpler branching instructions be added for purposes ofintroducing the concept of branching.
Based on teachers' reactions, the first 20 (S)LOGO lessons were revised,but not yet used with students. The revision attempts to correct the mainweakness of the course in its first version, the delayed introduction of theconcept of a stored program. Earlier introduction of stored programs("functions" in (S)LOGO) can provide a more meaningful and suitableframework for introducing string manipulation commands.
As was mentioned in the curriculum discussion, one of the powerfulfeatures of (S)LOGO is the ability to write recursive functions. The courseincluded an 11 lesson sequence designed to introduce and explore recursive functions. Unfortunately, recursive functions were introduced notlong after functions. Because they were confused about the nature offunctions in general, most students were advised to omit the lessons onrecursive functions. A version of the course which introduces functions inthe first few lessons should eliminate much of the confusion regardingrecursive functions.
Almost all students showed some confusion between the language theywere learning (SIMPER, (S)LOGO, or BASIC) and the language (English)used in the exposition. Part of this confusion undoubtedly arose because(S)LOGO and BASIC commands often closely resemble English. Forexample, a valid (S)LOGO command such as
COMPUTER PROGRAMMING
PRINT WORD OF "CAT" AND "NIP".
865
even includes a period at the end. Although this resemblance to Englishmost likely contributes to the confusion, the advantages of teaching anEnglish-based programming language outweigh the disadvantages.
Finally, a number of students seemed puzzled about which programthey were using-the instructional program or the interpreter (SI MPER,(S)LOGO, or BASIC) which was used for writing programs; some studentstried to ask the interpreter for hints about an assigned programmingproblem. Perhaps the new programming student cannot avoid some confusion between languages and between programs. So far, no entirely satisfactory way of dispelling the confusion has been found.
Woodrow Wilson High School has continued to incorporate computerprogramming into its instructional program. The Business Education Department has experienced a substantial increase in students and has organized a special program in Data Processing and Computer Sciences,offering courses in Automated Office Records, Key Punch, Introduction toData Processing, and Elementary Computer Programming.
REFERENCES
Feurizig, W., & Papert, S.A. Programming languages as a conceptual framework forteaching mathematics. Boston: Bolt, Beranek & Newman, 1968.
Friend, J. INSTRUCT Coders Manual (Tech. Rep. 172). Stanford, Calif.: StanfordUniversity, Institute for Mathematical Studies in the Social Sciences, 1971.
Kemeny, J. G., & Kurtz, T. E. The Dartmouth Timesharing Computing System: FinalReport. Washington, D.C.: National Science Foundation, 1967.
Lorton, P. SIMPER Riference Manual. Stanford, Calif.: Stanford University, Institute for Mathematical Studies in the Social Sciences, 1971.
Slimick, J. (S)LOGO Riference Manual. Stanford, Calif.: Stanford University, Institute for Mathematical Studies in the Social Sciences, 1971.
Slimick,j., & Lorton, P. SLAKER Reference Manual, 1969. Stanford, Calif.: StanfordUniversity, Institute for Mathematical Studies in the Social Sciences, 1971.
866
LESSON 28: NAME
LORTON & COLE
APPENDIX A
SAMPLE SIMPER LESSON
IT'S HARD TO FIGURE OUT AHEAD OF TI~1E WHAT STEP NUMBER YOUWANT TO JUMP TO, TO GET AROUND THIS PROBLEM YOU CAN USETHIS INSTRUCTION:
NAMESUPPOSE YOU WANT TO JUMP FROM STEP 021 TO STEP 050,YOU CAN CHOOSE TO LABEL OR NAME STEP 050 "GO",THEN YOU WRITE:
021 JMP GO P
050 NAME GO050
YOU TYPE TRIS AT STEP 050:NAME GO
TO TELL SIMPER TO LABEL STEP 050 "GO""THEN SIMPER PRINTS 050 AGAIN SO YOU CAN WRITE THEINSTRUCTION FOR STEP 050.
1. HOW SHOULD YOU LABEL STEP 011 "START"'?A. 011 NAMEB. 011 NAME STARTC. 011 STARTD. NONE OF THE ABOVE
• BRIGHT
2. HOW SHOULD YOU LABEL STEP 057 "DONE"?A. 057 DONEB. 057 LABEL DONEC. 057 NAME DONED. NONE OF THE ABOVE
• CCORRECT
HERE IS A PROGRAM THAT USES THE LABEL "CAT".THE PROGRAM DOES THIS:
PRINTS O-X IF X IS LESS THAN 0PRINTS X IF X EQUALS 0PRINTS X IF X IS GREATER THAN O.
COMPUTER PROGRAMMING
000 BEGINDOl GET X002 FIX :0003 CMP X004 Jl1P CAT P005 Jl1p :6 P006 PUT X007 Jl1p : 1 P008 NAllE CAT008 SUB X009 STOR Q010 PUT QOll Jl1P : I P012 END
3. TYPE THE ABOVE PROGRAH INTO SIMPER,EXECUTE IT USING THESE INPUT VALUES:IV1 X--9IV2 X=OIV3 X-7
*-G go to SIMPER from SLAKER
867
•••HERE'S SIMPER•••
LOC INSTR
8/7 /69 1023
000 BEGIN001 GET X002 FIX :0003 CMP X004 Jl1P CAT P005 Jl1p :6 P006 PUT X007 Jl1P : 1 P008 NAl1E CAT008 SU8 X009 STOR Q010 PUT QOll Jl1P :1 P012 END013 -X
BEG LOC? 0EIID LOC? 12
REG P REG A REG B
000 0 0DOl ?-9002 0 0003 0 0
execute SIMPER program
868
004 0 0008 9 0009 9 0010 9 0
9001 9 0001 ?O002 0 0003 0 0004 0 0005 0 0006 0 0
0007 0 0001 ?7002 0 0003 0 0004 0 0005 0 0006 0 0
7007 0 0001 ?
••• EXECUTION HALTED •••
*-C
••• HERE'S SLAKER•••
~mRE THESE YOUR RESULTS?
INPUT OUTPUTIVl 9In 0IV3 7
LORTON & COLE
return to SLAKER from SIMPER
*YESGOOD
4. LOOK AT THE PROGPAM FOR PROBLEM 3.HHAT STEP WAS LABELED "CAT lI ?A. 004B. 005C. 008D. NONE OF THE ABOVE
*?THE COMJIANO "NAME" IS USED BEFORE A LABEL.WHICH STEP IS LABELED "CATlI?
COMPUTER PROGRAMMING
*CCORRECT
5. SIGN ON TO SIMPER AND liRITE A PROGRfu~ TO DO THIS:
PRINT X TIl1ES X IF X IS LESS THAN OR EQUAL TO 15PRINT 99 IF X IS GREATER THAN 15.
IVI 81IV2 4IV3 15
*?THE PROGRAM WILL LOOK A LOT LIKE THE LAST ONE.JUMP TO THE STEP LABELED "HERE" IF J.C IS LESS THAN 15
OR X IS EQUAL TO 15. THEN FIND X TIMES X AND PRINT IT.Olill DIFFERENCE IN THE PROGRA}!: YOU WILL NEED TO FIX :99
AND STORE IT SO YOU CAN PRINT IT OUT IF X IS GREATER THAN 15.
go to SIMPER from SLAKER
•••HERE·S SIMPER•••
869
LOC013000001002003004005006007008009010010011012013014015016
INSTR-IBEGINFIX :99STOR YGET XFIX :15CMP X AJMP HERE PJ]1P HERE PPUT YJMp :3 PNAHE HERELOAD XHUL XSTOR ZPUT ZJMP :3 PEND-X
initialize SIMPER
Execute Program
BEG LOC? 0END LOC? 15
REG P REG A REG B000 0 0
870 LORTON & COLE
001 99 0002 99 0003 181004 15 0005 15 0006 15 0007 15 0008 15 0
99009 15 0003 14004 15 0005 15 0006 15 0010 4 0011 16 0012 16 0013 16 0
16014 16 0003 115004 15 0005 15 0006 15 0007 15 0010 15 0011 225 0012 225 0013 225 0
225014 1
••• EXECUTION HALTED •••
'-G Return to SLAKER
COMPUTER PROGRAMMING
APPENDIX B
SAMPLE (S)LOGO LESSON
26. SIGN ON TO LOGO AND l!RITE A FUNCTION NAIlED "GREET" THATTAKES A SENTENCE AS INPUT AIID PRINTS "WELCOME" FOLLOWED BYTHE SENTENCE. IF INPUT IS NOT A SENTENCE, IT PRIlITS "ONLYINPUT SENTENCES", FOR A CLUE, SEE PROBLEM 21.
AFTER THE FUNCTION IS WRITTEN, TRY IT ON THESE 4 INPUTVALUES. lIrVl" HEANS llINPUT VALUE I". TO TRY THE FUNCTIONO~i IV!, IITOM JONES II , TYPE THIS:
P GREET "TOM JONES H
NOTE THAT YOU DO NOT HAVE TO TYPE ~rOFF" WITH THE "pRINT lI
OR IIpl' COMHAND ..IVl "IGH JONES II
In 3IV3 "AGENT 007 11
IV4 liTO LANSING"
871
WHERE TO? *LOGO ••• OK go to LOGO from SLAKER
LOGO LIVESl*NOGO. initialize LOGO*TO GREET <K>
& IF SENTENCE? <K> THEN RT SEN OF IIHELCOME lI AND <K>.& END.
*p GREET OF "TOM JONES II ..
~ WELCOME TOM JONES*p GREET OF 3.
=NIL
*p GREET OF "AGENT 007".=,mLCO}lli AGENT 007
*p GREET OF "TO LANSING".=WELCOME TO LAlISINC
* .... OK
I;IPUTIVIIV2IV3IV{~
*
OUTPUTHELCOME TOIl JONESONLY INPUT SEIITENCESWELCOHE AGENT 007IffiLC011E TO LANSING
return to SLAKER from LOGO
27 _ SIGN ON TO LOGO AND URITE A FUNCTION NAMED "SQ"THAT MULTIPLIES AllY IIU}!BER BY ITSELF. FOR OTHER
872 LORTON & COLE
INPUT, PRINT "ONLY Nill1BER". TRY OUT THE FUNCTION ONTHESE INPUT VALUES:
IVlIV2IV3IV4
6:'}f..ARIE"-4llFLY BALLI!
WHERE TO? *LOGO.SORRY, LOGO BUSY
lillERE TO? *LOGO ••• OK
message occurred if 5 terminalswere already using LOGO
LOGO LIVES!*NOGO.*TO DUBNm <SQ>
& IF NUl1BER? <SQ> THEN RT TIMES OF <SQ> AND <SQ> ELSE RT "ONLYNUHBERS t' •&END.
*p DUBNill1 OF 6.=36
*p DUBNill1 OF IIMARIE".=ONLY NilllBERS
*p DUBNilll OF -4.~l6
*p DUBNUM OF "FLY BALL".=ONLY =BERS
*...OK
INPUTIV1InIV3IV4
*
OUTPUT36ONLY Nill1BERS16ONLY =BERS
28. SIGN ON TO LOGO AND WRITE A FUNCTION NAlfED "THIRD" THATPRINTS TIlE THIRD CHARACTER OF A WORD. FOR SENTENCES OF MORETHAN THREE WORDS, IT PRINTS THE THIRD WORD. FOR NmBERS, ITPRINTS "NO =BERS PLZ". USE THESE INPUT VALUES:
IV! "RABBIT"IV2 6IV3 "THE MOON IS HADE OF CHEESE"IV4 "T II
IVS I:WHAT A CAS ll
*WHERE TO? *LOGO ••• OK
COMPUTER PROGRAMMING
LOGO LIVES!"NOGO."TO THIRD <K>
& IF NUHBER? <K> THEN RT "NO NUHBERS PLZ" ELSE RT FIRST OF BFOF <K>.&END.
*p THIRD OF IIRABBIT".~A
"NOGO."TO THIRD <K>& IF NUHBER? <K> THEN RT "NO NUHBERS PLZ" ELSE RT FIRST OF
BF OF BF OF <K>.& END"P THIRD OF 6= NO Nm1BERS PLZ
"P THIRD OF "THE MOON IS MADE OF CHEESE".~ IS*p THIRD OF "T".=NIL
"P THIRD OF "lmAT A GAS.~GAS
*... OK
873
INPUTIVIInIV3IV4IV5
"
OUTPUTBNO NUHBERS PLZISNILGAS
874 LORTON & COLE
APPENDIX C
SAMPLE BASIC LESSON
[In the following sequence, student responses are marked by an asterisk.To request a hint the student types a question mark.]
LI8-5: NOW, FOR COUNTER X, LET THE INITIAL VALUE BE 3,THE STEP SIZE BE .25 AlID THE LAST VALUE BE 5.
FOR COUNTER Y, LET THE INITIAL VALUE BE 8, AlID THE STEP SIZE .5.(YOU DON'T NEED TO UORRY ABOUT THE LAST VALUE, SINCE YOU CANJUST CHECK ON X TO KNOll WHEN TO STOP LOOPING.)
WRITE A PROGRAlI TO FIND X*Y+3 FOR THE GIVEN VALUES.PRINT X, Y, AND X*Y+3 EACH TIME.
(YOU MAY WAUT TO LABEL THE COLmlNS "XII, "yn , AND lIX*Y+3"TO HAKE THE OUTPUT EASIER TO READ.)
*
[At this point the student may type HELP to initiate immediately a sequence of remedial problems. Or he may sign onto the BASIC interpreterand attempt to write the assigned program. When he is satisfied with hisresults, or decides he is unable to write the program successfully he signsoff the BASIC interpreter and back into INSTRUCT, the instructionalprogram.]
DID YOUR PROGRAM WORK OK?
* NO
TOO BAD. MAYBE THESE PROBLEMS WILL HELP.
XI8-I5: FIRST, AS USUAL, WE NEED TO SET THE INITIAL VALUES OFTHE COUNTERS. REREAD TIm PROBLEM TO FI1~ OUT IrnAT THE INITIALVALUES SHOULD BE.
TYPE THE INSTRUCTION TO SET THE INITIAL VALUE OF COlnlTER X.
* ?
THE IIllTIAL VALUE OF X SHOULD BE 3.
* LET X=3
GOOD. THAT'S LINE 10.