Given the following text file named Residence. txt in Figure 1 that contains the data about the owner of the apartment.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Given the following text file named Residence. txt in Figure 1 that contains the data about the owner of the apartment.
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. Figure 1: Residence.txt Write a complete Java program using the file I/O operation that can perform the following tasks: a) Read all records from text file named Residence. txt in Figure 1 b) Write information about female owner into file named female.txt as shown in Figure 2. The gender can be determined based on IC number where the last character of IC number represents the gender. If it is an even number, then the owner is a female. Figure 2: female.txt c) Close all file streams in used. d) Apply exception handling mechanism in the program. (10 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!