# Computing

## CONTENTS OF CURRICULUM UNIT 81.06.04

- Introduction
- The Meaning of Area
- Area of a Rectangle
- Computer Programs to Calculate the Area of a Rectangle
- Area of a Square
- Computer Programs to Calculate the Area of a Square
- Area of a Parallelogram
- Computer Programs to Calculate the Area of a Parallelogram
- Area of a Triangle
- Computer Program to Calculate the Area of a Triangle
- Area of a Trapezoid
- Computer Program to Calculate the Area of a Trapezoid
- Bibliography for Teachers
- Student Reading List

### Unit Guide

## Introducing Computer Programming in a Traditional Classroom

Your feedback is important to us!

After viewing our curriculum units, please take a few minutes to help us understand how the units, which were created by public school teachers, may be useful to others.

*
Computer Program to Calculate the Area of
*
a
*
Triangle
*

Program7introduces the idea of using the computer for or programmed learning. The student will do the problems then use the computer to check his answers. 10 REM FIND THE AREA OF A TRIANGLE 20 INPUT B, H 25 IF B 0 THEN 90 30 LET A = B*H/2 31 PRINT “WHAT IS YOUR ANSWER?” 35 INPUT A1 40 IF A1=A THEN 70 50 PRINT “YOUR SOLUTION IS NOT CORRECT. “ 51 PRINT “CALCULATE THE AREA AGAIN.” 52 PRINT “WHAT IS YOUR ANSWER THIS TIME? “ 53 INPUT A2 54 IF A2 = A THEN 70 55 PRINT “YOUR ANSWER STILL IS NOT CORRECT.” 56 PRINT “ YOU MAY TRY IT ONE MORE TIME.” 57 PRINT “WHAT ANSWER DO YOU HAVE NOW? “ 58 INPUT A3 59 IF A3 =A THEN 70 60 PRINT “YOUR ANSWER IS STILL WRONG. YOU WILL” 61 PRINT “NOT RECEIVE CREDIT FOR THIS PROBLEM.” 62 PRINT “GO ON TO THE NEXT PROBLEM.” 65 GO TO 20 70 PRINT “YOU ARE CORRECT. AREA=” A 71 PRINT “GO ON TO THE NEXT PROBLEM.’’ 72 GO TO 20 90 END Result: ? you type in the values of B and H.) WHAT IS YOUR ANSWER? ? (Here you type in your answer) YOU ARE CORRECT. AREA = GO ON TO THE NEXT PROBLEM. Or YOUR SOLUTION IS NOT CORRECT. CALCULATE THE AREA AGAIN. WHAT IS YOUR ANSWER THIS TIME? ? (Here you type in your answer.) YOU ARE CORRECT. AREA = GO ON TO THE NEXT PROBLEM. Or YOUR ANSWER STILL IS NOT CORRECT. YOU MAY TRY IT ONE MORE TIME. WHAT ANSWER DO YOU HAVE NOW? ? (Here you type in your answer.) YOU ARE CORRECT. AREA = GO ON TO THE NEXT PROBLEM. Or YOUR ANSWER IS STILL WRONG. YOU WILL NOT RECEIVE CREDIT FOR THIS PROBLEM. GO ON TO THE NEXT PROBLEM.

###
*
Explanation of Program
*
7:

Line 20 causes the computer to stop and wait for the student to type in the values of the base and altitude of the triangle. Line 25 indicates that the program is finished and should stop when a negative value is assigned to the base. Line 30 provides the formula to find the area of the triangle. Line 31 asks the student for his answer. Line 35 causes the computer to wait until the student types in the answer that he has calculated to be the area of the triangle. Lines 40 indicate that the student has obtained the right 70, 71 answer and may proceed to the next problem. Line 72 reroutes the computer back to line 20 to obtain the values of the base and altitude of the next triangle. Lines 50 tell the student to solve the problem again, 51 because his answer is wrong. Line 52 asks the student for his second answer to the problem. Line 53 causes the computer to wait until the student types in the answer that he has just found. Lines 55 tell the student that his answer is still wrong, 56 but he may have one more chance to solve the problem correctly. Line 57 asks for the answer obtained on the third try. Lines 60 tell the student that his answer is wrong, 61, 62 credit will be given for the problem. He may not try again, but should Line 63 reroutes the computer back to line 20 to obtain the values and altitude of the next triangle.