Kathleen M. Huhner
I should first like to discuss the prerequisites of the course, in an attempt to give a little background. In order to take this course, a student must be a sophomore (though freshmen in the advanced sequence have been accepted) and must have passed a course higher than Applied Math. In addition to this the student must take a regular mathematics course, unless he has completed the two years required by the state, These conditions were stated to avoid some of the difficulties that would not be desirable while developing a new course.
The course work deals mainly with the Radio Shack TRS-80 Level II and Level III computers. Programs are written by the on the computers. Corrections are then is repeated. The class meets five days a week, as is done for major subjects.
The texts used in the course are many, but mainly they are
BASIC:
An Introduction to Computer Programming Using the BASIC Language
by William Sharpe and Nancy Jacob and
Computer Pro
g
ramming
in the
BASIC Language
by Neal Golden.
The opinion of the students is that Sharpe and Jacob’s book is more useful, at least for the introduction to BASIC.
I propose the following be a tentative schedule for BASIC beginners (you might find that you spend a larger (or smaller) amount of time on any given topic):
Week 1: I, Diagnostic Test
-
II. Digital and Analog Computers
-
III. How Digital Computers Work
-
____
A. Communication with the computer
-
____
B. Parts of the Computer
Weeks 2 & 3: I. Programming the Computer
-
____
A. Absolute machine language
-
____
B. Assembly language
-
____
C. Source language
-
____
D. Object language
-
II. The Programming Capability of BASIC
-
III. Field Trip to a Computer Center
-
IV. Flowcharting
-
V, Logging On and 0ff the Computer
-
VI. Test on Flowcharting
Week 4: The Basic Vocabulary of BASIC
-
I. PRINT (handles output), END (last statement)
-
II. Operations Hierarchy in BASIC
-
III. RUN (executes all statements in memory), SCR (erases a program from computer memory), LIST (causes the computer to type out all the statements in its memory)
-
IV. LET (used for computing and storing numbers)
-
V. Rules Regarding Variables
-
VI, INPUT (handles input)
Weeks 5 & 6: Data and Transfer of Control
-
I. READ (names variables; reads in data), DATA (stores values for variables in READ statement)
-
II. GO TO (unconditional)
-
III. IF. . .THEN (conditional), STOP (causes the computer to cease the execution of a program)
Weeks 7, 8, & 9: Loops and Library functions
-
I. FOR. . .NEXT
-
II. FOR. . .NEXT. . .STEP
-
III. Nested Loops
-
IV. DIM (used for subscripted variables)
-
V. REM (remark statement)
-
VI. Library Functions in BASIC (SQR, INT, ABS, RND)
The course begins with a diagnostic test. The test measures the student’s level of mathematical ability and affords the teacher the opportunity to see how diverse (mathematically) the students are. The following few days are spent
on an
introduction to what a computer is, what physical units it consists of, and mainly what it is not. This is followed by (time and money allowing) a trip to the Yale Computer Center or to the University of New Haven Computer Center to see a machine in operation. By this time the students have begun their study of flowcharting.
It seems to begin the study of algorithms and programming by using a flowchart—a step-by-step outline of the procedure to be followed by the computer. The structure of algorithms can be seen more effectively in flowcharts than in any other representation. The following symbols are used by the students:
Symbols of the Logical Flowchart
(figure available in print form)
The Oval is used to signal the beginning and ending of a flowchart.
(figure available in print form)
|
|
The Parallelogram is used to designate input or output.
(figure available in print form)
The Rectangle is used for arithmetic assignments.
(figure available in print form)
The Diamond is used for decisions.
(figure available in print form)
The Circle acts as a connector between one portion of a flowchart and another.
(figure available in print form)
The Arrows show the flow of the steps of the flowchart.
Once the students master the symbols and have seen some examples, they are given their first assignment: Flowchart your actions from the time you awaken until you board the bus for school. The following day the students compare their flowcharts. Through discussion and comparison, they soon understand the properties and structures of algorithms and are able to select (and appreciate) a good algorithm in preference to a poor one.
Problems are introduced that benefit from being programmed and run on the computer. Hence it is a logical step to incorporate problems which involve mathematical notation and BASIC commands into the flowcharts (see Appendix A, example 1). The logic of each flowchart should be followed and tested using a trace (see Appendix A, example 2).
Some flowchart assignments I have given to the students are:
-
1. Read two real numbers; multiply them and divide the result by two.
-
2. Compute the (a) perimeter of a triangle and (b) area of the triangle (using Hero’s formula) given the lengths of the sides.
-
3. Read a real number X, If X is nonnegative, give its square root. If X is negative, print “NO REAL SQUARE ROOT.”
-
4. Compute an employee’s weekly wage, given his rate-per-hour and the number of hours worked. (Assume that the employee receives time and a half for overtime).
Again, students compare their flowcharts in class. They also perform traces and rectify any errors or omissions.
Beginning with his section and continuing throughout the rest of the course, students learn how to write programs in the BASIC language. The flowchart assignments were chosen with BASIC in mind, so students should find the transition from flowcharting to programming to be relatively simple. For example, study the BASIC program beside its corresponding flowchart on the following page.
Students now go to the computer room and run their programs. As you can well imagine, the students watch—with considerable excitement- their own programs run. From then on, students use the computer room more and more. They seem to enjoy the busy atmosphere of the place which teems with students, By the middle of October, students may begin using their study halls and free periods to get in runs of their programming assignments.
*Note: If the students run the following program, they soon find that the computer calculates and prints three areas. The fourth time it returns to the READ statement, it finds there are no more numbers in the data list and prints OD 10 (out of data in line 10). It then terminates execution of the program.