DECLARE FUNCTION CountOfA(s$, ch$)
word1$ = ""
INPUT "Type a word"; word1$
PRINT "A = "; CountOfA(word1$, "A")
PRINT "O = "; CountOfA(word1$, "O")
FUNCTION CountOfA(s$, ch$)
CountOfA = 0
ch$ = UCASE$(ch$)
FOR i = 1 to Len(s$)
IF UCASE$(MID$(s$, i, 1)) = ch$ THEN CountOfA = CountOfA + 1
NEXT
END FUNCTION