I am supposed to call two service classes from one client(main) class?
sheharyar alam
Greenhorn
Joined: Mar 04, 2008
Posts: 4
posted
0
hey guys, if someone can help me on this program, it would be great
I am trying to do the following:
PART I
1. the total sales for each week? 2. the average daily sales for each week? 3.The total sales for all the week? 4.the average weekly sales?
PART II
readText(): Read text line-by-line and print it as it appears in the given data file, also print number of line read from the data file?
storeTokens(): open file again, read the whole line and tokenize it; and store tokens in an array of strings (call it words or tokens array). the punctuation marks may be a comma, semicolon, question mark, colon, or a period (',' ':', ';', '.').
printToken(): print all extracted words; 10 words to a line. Also print the total number of words stored in the array.
alphabetizeTokens(): alphabetize the words and again print them using printToken() method mentioned above. Print 10 words to a line again.
doFrequency(); compute frequency and print each unique word along with its frequency in the data file under appropriate headings as shown in the sample output. Number the output lines.
AND SO FAR I HAVE THE FOLLOWING CODE :
// this is for part I service class, in this class all I need to do is some how do the summary: // number of weeks data processed: //total sales for all weeks: //average weekly sales:
System.out.println(" Number of Lines Read = 4 "); System.out.println("_____________________________________________"); System.out.println(""); System.out.println(" All Words without Punctuation Marks "); System.out.println(Token); }
catch(Exception a) { System.out.println("File not found");
public class SalesS { public static void main (String[] args) throws IOException { Sales mysale = new Sales(); //mysale.topOfPageInfo(); mysale.readData();
TokenS mytoken = new TokenS(); mytoken.readText();