aspose file tools*
The moose likes Beginning Java and the fly likes sorting student records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "sorting student records" Watch "sorting student records" New topic
Author

sorting student records

avelin chen
Greenhorn

Joined: Dec 11, 2005
Posts: 27
Could someone give me some pointers on how to start this porgram? Thanks in advance!

Write a program that retrieves the "Lab17a.dat" text file. This is the same text file that you used for the Lab17a assignment with the same student record format. For this assignment you will not only retrieve a text file, but also create a new text file. This means that in addition to using the FileReader class and the BufferedReader class, you will also need to use the FileWriter class and the BufferedWriter class of the java.io.* package.

Retrieve the "Lab17a.dat" file and check the gpa of each student record. A new file, called "Lab17b.dat", is created with all student records purged that have gpas below 2.0. As you execute the program you need to display the record of each student that will be purged, along with a count of the total records purged.

First output:
Name: Ann Seaborn
GPA: 1.785

Name: Mary Pridgen
GPA: 1.957

Name: Steven Johnson
GPA: 0.785

Name: Tom Tooch
GPA: 1.456

Name: Mike Bruun
GPA: 1.783


Total records purged: 5

Second output
Bart Reagor
27
2.075
Kristyn Reckner
19
3.225
Paul Reiman
41
4.000
Andy Reitinger
20
3.525
William Reynolds
50
3.375
William Robbins
34
2.875
Brian Roberts
23
3.175
Lauri Robertson
19
2.925
Richardson Robinson
26
3.210
Laurie Rosemberg
45
4.000
Barbara Salsa
18
3.000
Lori Salbury
23
3.455
Diane Simcox
32
2.175
Kevin Sims
67
3.235
Michael Ward
19
3.451
Cheryl willis
37
3.576
Tracy Springer
41
2.305
Nancy Barone
25
2.975
Patti Skinner
47
2.743
Diana Rockel
56
3.456
Michelle Ritter
25
4.000
Mali Cozart
16
2.345
Todd Deans
22
2.023
Laura Collins
30
3.999
Debbie Mozart
40
2.999
Gordon Collins
25
3.100
Susan Craft
29
3.754
Vance Brawner
31
3.678

Thanks again!
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by avelin chen:
Could someone give me some pointers on how to start this porgram? ...

Could you show us what you have so far, and tell us exactly where you're stuck?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I always recommend you restate the problem in the simplest "structured English" you can manage. This one might be something like:

Then I'd try to translate it into almost exactly that many lines of Java. That means most of those lines would be calls to other methods. If you make the other method names really good the code will read just as easily as this description.

So, where are you stuck? The instructions tell you about some IO classes. Are you ok with those?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sorting student records