PDA

View Full Version : reading files using the scanner method in java.


mjroodt
08-17-2005, 03:14 PM
I seem to have these problems with being able to read files using the scanner method.

If anyone could help me it would be great.Again the original code was in pseudocode so i need to convert it to java.

here it is,please can someone show me how to do this using the scanner method.


Module 6 : acceptData
IN : MonthNum, FileName
OUT : ---
BEGIN
6.1 Display MonthName[MonthNum]
6.2 Read Rainfall[MonthNum] from FileName
6.3 Display Rainfall[MonthNum]
6.4 Read MaxTemp[MonthNum] and MaxDay[MonthNum] from FileName
6.3 Display MaxTemp[MonthNum] and MaxDay[MonthNum]
6.6 Read SunHours[MonthNum] from FileName
6.5 Display SunHours[MonthNum]

nikkiH
08-17-2005, 04:09 PM
Learn to read the API docs. They're going to be your best friends soon. :D

scanner (http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html)
(there's a simple example there)