Question
Asked by:
$10.00 Java - read text from an input file and write to new output file based on values
- From Computer-Science: Object-Oriented-Programming , Computer-Science: General-CS
- Closed, but you can still post tutorials
- Due on Jul. 18, 2009
- Asked on Jul. 13, 2009 at 12:00:34AM
Q:Develop an application that reads city, state, and population from an input text file.
Example census input text file should be of the format:
Jamestown FL 50000
Domville CO 10000
Jennyboro FL 30000
Lillyville CO 50000
City should be the first field, state abbreviation should be the second field, and the population (no commas) should be the third field. White spaces (no commas) should be used as the delimiter between each field and a platform independent line separator should be used at the end of each city record. This file will be used as input to a future application which is why the format is important.
If the population of the city is greater than or equal to 50,000 write the city information to a text file called BigCities.txt. If the population of the city is less than 50,000 write the city information to a text file called SmallCities.txt.
If your output file(s) already exist, you should append to it, not overwrite.
Explain which input and output stream classes used and your reasons for your choice.
Before you write any Java code, start with planning comments also known as pseudocode. These comments will serve as the outline of your logic for each method including your test application. The comments should be left in your code and part of your grade will come from these comments.



