Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 3 (15 MARKS) The following text file named vaccination.txt in Figure 1 contains some information about vaccination data for adults in Klang Valley
QUESTION 3 (15 MARKS) The following text file named vaccination.txt in Figure 1 contains some information about vaccination data for adults in Klang Valley area. The data is comprised of the vaccination center, identification (ic) number, category, vaccine type and dose. The ic number represents the date, state born and gender of person where the first 6 digit represents the birth date, the 2 digits after the birth date represents the state in Malaysia and the last digit represents the gender. vaccination - Notepad File Edit Format View Help Bukit Jalil Stadium: 860619-14-0310: non-comorbid: Pfizer: 2 IDCC Shah Alam: 700721-10-6789: non-comorbid : AstraZeneca:1 PWTC KL:940712-03-5433: comorbid: Pfizer:3 MBPJ Hall:880321-10-7890: comorbid: Pfizer: 2 Bukit Jalil Stadium: 660606-06-5664: non-comorbid: Sinovac:2 SCCC Setia Alam: 770901-01-4533 :: comorbid: Pfizer:1 PWTC KL:811111-10-8678: non-comorbid: AstraZeneca: 3 IDCC Shah Alam: 910101-05-6767: comorbid: Sinovac:2 Figure 1: vaccination.txt Write a complete Java program using File I/O operation that can perform the following tasks: a) Read all records from the text file named vaccination.txt in Figure 1. b) Display every information about those who were born in Selangor and received the booster dose (dose 3) on screen. The person who was born in Selangor is represented by the two digit there is 10 after the six digits that represents the birth date from the identification (ic) number. c) Write the information about comorbid person into the file named comobid.txt as shown in Figure 2. *comorbid - Notepad File Edit Format View Help List of Comorbid Vaccination Center PWTC KL MBPJ Hall SCCC Setia Alam IDCC Shah Alam IC Number Vaccine Type 940712-03-5433 Pfizer 880321-10-7890 Pfizer 770901-01-4533 Pfizer 910101-05-6767 Sinovac Figure 2: comorbid.txt Dose 3 NEN W 2 1 2 d) Write the information about non-comorbid person into the file named non_comobid.txt as shown in Figure 3. *non-comorbid - Notepad File Edit Format View Help List of non-comorbid Vaccination Center Bukit Jalil Stadium IDCC Shah Alam Bukit Jalil Stadium PWTC KL IC Number Vaccine Type Dose 860619-14-0310 Pfizer 700721-10-6789 AstraZeneca 660606-06-5664 Sinovac 811111-10-8678 AstraZeneca Figure 3: non_comorbid.txt e) Close all file streams in used. f) Apply exception handling mechanism in the program. === 2 WNIN 1 2 3 (15 marks)
Step by Step Solution
★★★★★
3.48 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Code import javaio public class VaccinationDetails public static void mainString args throws IOExcep...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started