• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sorting student records

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic