subject
Engineering, 07.03.2020 05:41 bgcxz

Please add comments to your program to explain it. Thank you!

In this assignment, you will create a Java program to read undergraduate and graduate students from an input file, sort them, and write them to an output file.

1. The input file name and the output file name are passed in as the first and second arguments at command line, respectively. For example, assume your package name is FuAssignment5 and your main class name is FuMain, and your executable files are in "C:\Users\2734848\eclipse-workspace \CIS 265 Assignments\bin". The following command line will read from a local file "students. txt" and write to a local file "students_sorted. txt": C:\Users\2734848\eclipse-workspace\ CIS 265 Assignments\bin > java FuAssignment5.FuMain students. txt students_sorted. txt

2. If the program is run with incorrect number of arguments, your program must print an error message and exit. The error message must show correct format to run your program, e. g., "Usage: FuAssignment5.FuMain input_file output_file" where FuAssignment5 is the package and FuMain is the main class.

3. Each line in the input file represents a student. There are 5 fields in each line: name, id, gpa, "graduate" or "undergraduate", isTransfer (for undergraduate) or college (for graduate). The fields are separated by comma, ",". For example, the input file students. txt file may contain: Michelle Chang,200224,3.3,graduate, Cleveland State University Tayer Smoke,249843,2.4,undergraduate, false David Jones,265334,2.7,undergraduate, true Abby Wasch,294830,3.6,graduate, West Virginia

4. The program will read the lines and create undergraduate students or graduate students accordingly. The students are added to an ArrayList.

5. The program then sort the students in ArrayList in ascending order of their id.

6. The sorted list of students is written to the output file.

ansver
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, makaylashrout77
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
image
Engineering, 04.07.2019 18:10, oliviasoreo92
Compute the pressure drop of 30°c air flowing with a mean velocity of 8 m/s in a circular sheet-metal duct 300 mm in diameter and 15 m long. use a friction factor, f 0.02, and pair = 1.1644 kg/m a. 37.26 pa b. 25.27 pa n c. 29.34 pa d. 30.52 pa
Answers: 1
image
Engineering, 04.07.2019 18:20, safiyabrowne7594
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
image
Engineering, 04.07.2019 18:20, aly95
An engine runs on the ideal diesel cycle. the cycle has a compression ratio of 20 and a cutoff ratio of 2. the highest temperature in the cycle is 1200 k. if the heat into the system is 300 kj/kg of working fluid and using variable specific heats determine the work produced per mass of working fluid
Answers: 3
You know the right answer?
Please add comments to your program to explain it. Thank you!

In this assignment, you wi...

Questions in other subjects:

Konu
Mathematics, 06.10.2019 05:00
Konu
Mathematics, 06.10.2019 05:00