• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Merging a file and sort it with Merge Sorting

Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really need help with this, I cannot figure it out with the sorting methods I was very sick and got behind.
General Instructions:  In this lab you will work with a program that:

1. reads a serialized file of Generals of the Civil War
2. loads the file into an array
3. sorts the array
4. searches for records from the array
5. prints a record if it is found
6. prints an error message if it is not found
In the zipped folder you will find 4 files:

1. General:  a java file that contains the  general ADT, YOU WILL MODIFY this file

2. GeneralRosters:  a java file that YOU WILL MODIFY to make a well-formed class

3. generalMaster:  this is a serialized file that contains the  general data, the files contents are reflected in the program run that is found below. YOU WILL NOT MODIFY this file  

4. GeneralRostersTest:  a driver file to run your application, YOU MIGHT MODIFY this file but it will not contain any logic other than creating your Application and method invocations for that application.

Once you download and unzip the folder read through the programs.  Understand the method calls in the tester. After you have read the files you should compile the programs and run the GeneralRostersTest.  
Remember: source files in src folders but put the .ser file at the project level.
The run will print a listing of the roster array.  It will be unsorted. The output before you modify the programs will look like this:

https://filebin.net/56gktns2c9sauhot     < ---- this is the java files needed
[Thumbnail for SampleOPutput.jpg]
Sample Output for the Sorting
Posts: 76802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post the entire files; many people are reluctant to go to a distant website. Please don't write coloured text; some people cannot read some colours, so I have turned it all back to black.

If you have been ill, have you told your teachers and the CS department?

So, you have a “serialised file”? Does it say what sort of object has been serialised into it? Is it a General[]? What do you know about serialisation and deserialisation? Have you read the Java™ Tutorials?
Have you found any sort of tutorial showing you how to write a merge sort? What criteria are you using for the sorting?
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic