1111#Bill#Jones#55895.25
1234#Mary#Smith#95875.50
2222#Andile#Makanda#67892.00
2223#Susan#Stofberg#43569.35
3345#Lihle#Tshabalala#88795.75
2323#Steve#Adams#55890.80
4333#Siya#Mlenga#64290.50
3445#Khaya#Poswa#27850.55
5677#Jimmy#Davis#57860.95
1. Open and read the input txt file, StaffData.txt.
2. Create an object of type Staff representing each input line.
3. Add each Staff object to an arraylist.
4. Close the input file.
5. Open an output txt file.
6. Sort the objects in the arraylist in alphabetical order of surname.
7. Loop thru your arraylist and write all the staff objects with a salary exceeding
R50 000 to the output file. Use the printToFile () method.
Include appropriate headings.
Include a count of the number of staff members written to the file at the end of the report.
8. Close the output file.
Comments
Leave a comment