Pgm5.Step2

Pgm5.Step2 - Step 2. So, you can access and printout a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Step 2. So, you can access and printout a line. We need to access tokens in each line. As designed, there are three, each separated by a comma. So, now (we can comment out the printing of the entire line, if we wish) we need to see if we can get a complete token and print it out (for verification). A token is a president’s name, the question, and the complexity per line. We need to, of course, process the entire file. Before we can proceed with anything else in the program, we need to ensure that we can get to this point. RR See added code: ¹± while ( ( CurrentLine = fileHandle.readLine() ) != null ) ÏϧÏϧÏϧÏÏ5 { ÏϧÏϧÏϧÏÏ7¹¹Ï System.out.println(CurrentLine); ÏϧÏϧÏϧÏÏ7¹íÏ StringTokenizer st = new StringTokenizer(CurrentLine, "," ); ÏϧÏϧÏϧÏÏ7¹¹± while (st.hasMoreTokens()) ÏϧÏϧÏϧÏÏ5ÏÏ5 { ÏϧÏϧÏϧÏÏ5ÏÏ7¹¹Ï Currenttoken = st.nextToken(); ÏϧÏϧÏϧÏÏ5ÏÏ7¹¹Ï System.out.println(
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/26/2011 for the course COP 2551 taught by Professor Roggio,r during the Summer '08 term at UNF.

Page1 / 2

Pgm5.Step2 - Step 2. So, you can access and printout a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online