Saturday
May 30, 2015

Homework Help: cis

Posted by ami on Friday, February 25, 2011 at 4:15pm.

I have to find three errors and ther two logic and syntax error. HELP ME IN IT AND Below is code.




Rem ===========BEGIN SAMPLE CODE============

REM Read 9 scores and report the average
Dim score(10)

For i = 1 to 10
CALL fillArray
PRINT "The average score is "; Sum()/10:
Next j
End


SUB fillArray
count = 0
For i = 1 to 10
READ datum
if datum > 0 then score(i) = datum
if datum = -1 then
exit sub
end if
count = count + 1
PRINT count, datum
Next i

DATA 85, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 84, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 83, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 82, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 81, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 79, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 78, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 77, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 76, 92, 68, 84, 86, 94, 74, 79, 88, -1
DATA 75, 92, 68, 84, 86, 94, 74, 79, 88, -1
END SUB

FUNCTION Sum()
total = 0
FOR i = 1 TO 10
LET total = total + score(i)
NEXT i
Sum = total
END FUNCTION

Rem ===========END SAMPLE CODE============

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Members