06-03-2004, 06:01 PM
Im making a program, in which you have 3 options. Create a file, FInd how many vowels, and quit. What it does is creates a file which the user gets to say how many words are in it, and how many vowels are in the words.
Example
1.Create a file
2.Count the Vowels
3.Quit
Pick 1
How many words would you like to put.
3
-car
-bat
-animal
1.Create a file
2.Count the Vowels
3.Quit
Pick 2
There are 5 vowels in this file.
So far all i cant get is the vowel portion, here is what code i have.
C: CLS
PRINT "Vowel program"
PRINT "----------------------------------------"
PRINT "----------------------------------------"
PRINT "1.Create a file."
PRINT "2.Count The Vowels."
PRINT "3.Quit"
INPUT "choose"; x
IF x <> 1 AND x <> 2 AND x <> 3 THEN GOTO C
IF x = 1 THEN GOTO line1
IF x = 2 THEN GOTO line2
IF x = 3 THEN END
CLOSE #1
line1:
INPUT "how many words do you want to enter"; a
OPEN "H:APR30R.txt" FOR OUTPUT AS #2
FOR i = 1 TO a: CLS
INPUT "Enter a word"; n$
WRITE #2, n$
NEXT i
CLOSE #2
line2:
Example
1.Create a file
2.Count the Vowels
3.Quit
Pick 1
How many words would you like to put.
3
-car
-bat
-animal
1.Create a file
2.Count the Vowels
3.Quit
Pick 2
There are 5 vowels in this file.
So far all i cant get is the vowel portion, here is what code i have.
C: CLS
PRINT "Vowel program"
PRINT "----------------------------------------"
PRINT "----------------------------------------"
PRINT "1.Create a file."
PRINT "2.Count The Vowels."
PRINT "3.Quit"
INPUT "choose"; x
IF x <> 1 AND x <> 2 AND x <> 3 THEN GOTO C
IF x = 1 THEN GOTO line1
IF x = 2 THEN GOTO line2
IF x = 3 THEN END
CLOSE #1
line1:
INPUT "how many words do you want to enter"; a
OPEN "H:APR30R.txt" FOR OUTPUT AS #2
FOR i = 1 TO a: CLS
INPUT "Enter a word"; n$
WRITE #2, n$
NEXT i
CLOSE #2
line2: