Question
Asked by:
sarah_whitten
sarah_whitten
Rating : No Rating
Questions Asked: 9
Tutorials Posted: 0
 

$4.00 I am lost netbeans

Q:

must be in netbeans only

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. Your file may 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 the file and not overwrite it. Your output text files should be in the same format as the input census text file. 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. Your output files may be used as input to a future application which is why the format is important.

Your application should execute by running the main project. Do not submit any code within your project that is not related to this assignment.

 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
topteacher12
topteacher12
Rating (15): D
Questions Asked: 0
Tutorials Posted: 115, earned $150.08
 

$5.00 A+ Answer

  • This tutorial hasn't been purchased yet.
  • Posted on Oct 15, 2009 at 11:32:57PM
A:
Preview: ... reads city, state ...

The full tutorial is about 14 words long plus attachments.

Attachments:
2009-08-31_202112_cities.zip (16K) 

 cities/build.xml
 cities/build/classes/.netbeans_automatic_build
 cities/build/classes/cities/Cities.class
 cities/build/classes/cities/index.txt
 cities/build/classes/index.txt
 cities/build/index.txt
 cities/dist/cities.jar
 cities/dist/README.TXT
 cities/input.txt
 cities/manifest.mf
 cities/nbproject/build-impl.xml
 cities/nbproject/genfiles.properties
 cities/nbproject/private/private.properties
 cities/nbproject/private/private.xml
 cities/nbproject/project.properties
 cities/nbproject/project.xml
 cities/src/cities/Cities.java
 ]

Posted by:
ameliorator
ameliorator
Rating (114): A
Questions Asked: 38
Tutorials Posted: 713, earned $3,790.04
 

$4.00 help you need...

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Oct 15, 2009 at 11:43:34PM
A:
Preview: ... d click on free user on the pa ...

The full tutorial is about 22 words long .
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$10.00 Java:, read, sort, write to files(appending), Scanner in, PrintWriter out, NetBeans folder, UseNotes, ScreenShot

  • This tutorial hasn't been purchased yet.
  • Posted on Oct. 16, 2009 at 12:30:04AM
A:
Preview: ... t = 0; // keep reading until file is exhausted:             while (inStream.hasNext()) {                 count++;                 line = inStream.nextLine();                 System.out.print(" " + count + ") " + line); // break line into compnent substrings around spaces:                 part = line.split(" "); // population is the third element of the line:                 double population = Double.parseDouble(part[2]); // sort into big or little output files:                 if (population >= 50000) {                     System.out.println(" ---> " + bigOutFileName);                     bigOutStream.println(line);                 } else {                     System.out.println(" --> " + smallOutFileName);                     smallOutStream.println(line);                 }   ...

The full tutorial is about 361 words long plus attachments.

Attachments:
CensusSort.java (3K) (Preview)
CensusSortUseNotes.txt (1K) (Preview)
CensusSortScreenShot.jpg (48K) (Preview)
CensusSortZipped.zip (19K) 

 CensusSortZipped/CensusSort/build.xml
 CensusSortZipped/CensusSort/build/classes/CensusSort.class
 CensusSortZipped/CensusSort/CensusData.txt
 CensusSortZipped/CensusSort/dist/CensusSort.jar
 CensusSortZipped/CensusSort/dist/README.TXT
 CensusSortZipped/CensusSort/manifest.mf
 CensusSortZipped/CensusSort/nbproject/build-impl.xml
 CensusSortZipped/CensusSort/nbproject/genfiles.properties
 CensusSortZipped/CensusSort/nbproject/private/private.properties
 CensusSortZipped/CensusSort/nbproject/private/private.xml
 CensusSortZipped/CensusSort/nbproject/project.properties
 CensusSortZipped/CensusSort/nbproject/project.xml
 CensusSortZipped/CensusSort/src/CensusSort.java
 CensusSortZipped/CensusSortOutput.html
 CensusSortZipped/CensusSortOutput.txt
 CensusSortZipped/CensusSortUseNotes.txt
 ]

   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty