Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File handling in JAVA  RSS feed

 
Kavitha Ramanathan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The given data file is as follows�
01234222Australia$0.40
53667India$6.80
654864Singapore$0.80
000000
01234222�..15
53667�..20
here There the first number represents country code,
second is the country name and third is the amount
charged per min. Now we have to check to the point
000000. Till 000000, it represents the IDD code and
the corresponding charges. After 000000 comes the
actual data. The data is as I shown. 01234222,
Followed by the total number of mins. Now here in the first record after 000000, the total number of min is 15. So from the
given record, for the IDD number 01234222 we need to
find out from the first part what country it is and
what is the rate and then calculate the amount for 15
min,, and display on the screen. The screen format
will be somewhat like this..
Country code country name address charge
amount per min total amount.

In the second part we need to tokenize the fields, I
think they will be separated by spaces or some
delimiter.
Pls let me know how to do this using file handling in JAVA
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm going to move this over to the I/O and Streams forum as it's not related to Certification Study.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!