This is a question:
**************************************************************
The parameter of the procedure is the disk name of the
text file.The procedure will count the number of
words in the text file which begins with "a " ,which
begins with "b" , "c", etc and store the result in
some appropriate array.The array will be another
parameter of the procedure(eg.for instance ,if we
have the word , BOBBOBOSCO ,there are 4B ,4O,1S,1C.in
other words,the output will be the frequency of
occurence of each word in an array.
)
*************************************************************************
This is what I've started up to now.And the other problem my syntax is terrible in this case ,but i think got at least an idea how it supposed to look like but i dont know how to implement it,I can make an outline
for instance:
Static int CountAlphabet( String count.txt) throws exception
{
int count,i,sum;
count = i;
sum=0;
int [] words =new int[words.length];
for (int i=0;i<words.length;i++)
if words[i] = words[i+1]
count+=; ...................... Just have look hint me on some mistakes im doing.
**************************************************************************
package Methew;
import sugar.*;
public class Count{
public static void main(String[]args){
Sys.pln("Enter any word ");
String word = Sys.readLine();
CountAlphabet();
}
static string CountAlphabet(int[]array)
{
int sum=0;
int[]array = new int[ array.length];{
for(int i=0;i<array.length;i++)
{ int k;
k=i;
if array[i] =array[i+1]
sum+= k;
}
Sys.p("There are" +sum)
Sys.pln(" "+array[i])
}
}