Given the following text file named Residence.txt in Figure 1 that contains the data about the owner of the apartment. The data is comprised of owner’s IC number, name, unit, level and block of...


Given the following text file named Residence.txt in Figure 1 that contains the data about the owner of the apartment. The data is comprised of owner’s IC number, name, unit, level and block of apartment.


Write a complete Java program using the file I/O operation that can perform the following tasks:


Read all records from text file named Residence.txt in Figure 1


Store all data into an output file named block1to5.txt. The file should contain only residents that live in from block 1 till block 5.


Close all file streams in used.


Apply exception handling mechanism in the program


Residence - Notepad<br>File Edit Format View Help<br>770123-10-5344;Nuraina binti Ali;23;6;2<br>721109-14-5665;Ahmad Sabry bin Sukri;6;2;10<br>810616-03-5775;Muhammad bin Tulus;12;5;7<br>800321-06-5228;Siti Mariah binti Jamian;11;3;1<br>841130-04-5776;Hanizah binti Salleh;10;4;5<br>(more data)<br>

Extracted text: Residence - Notepad File Edit Format View Help 770123-10-5344;Nuraina binti Ali;23;6;2 721109-14-5665;Ahmad Sabry bin Sukri;6;2;10 810616-03-5775;Muhammad bin Tulus;12;5;7 800321-06-5228;Siti Mariah binti Jamian;11;3;1 841130-04-5776;Hanizah binti Salleh;10;4;5 (more data)

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here