DECLARE FUNCTION CountOfA(s$)
word1$ = ""
word2$ = ""
word3$ = ""
INPUT "Type first word"; word1$
INPUT "Type second word"; word2$
INPUT "Type third word"; word3$
PRINT CountOfA(word1$)
PRINT CountOfA(word2$)
PRINT CountOfA(word3$)
FUNCTION CountOfA(s$)
CountOfA = 0
FOR i = 1 TO LEN(s$)
IF UCASE$(MID$(s$, i, 1)) = "A" THEN CountOfA = CountOfA + 1
NEXT
END FUNCTION