QUESTION 3 (15 MARKS) The following text file named vaccination.txt in Figure 1 contains some information...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
Code import javaio public class VaccinationDetails public static void mainString args throws IOExcep... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
To play the PowerBall lottery, you buy a ticket that has five numbers in the range of 169, and a PowerBall number in the range of 126. (You can pick the numbers yourself, or you can let the ticket...
-
According to the Mortgage Bankers Association, 10% of all home mortgage loans in California were in foreclosure in the fourth quarter of 2011. Assuming this rate holds, if you randomly pick 30...
-
What are the basic controllable variables of a production planning problem? What are the four major costs? Discuss.
-
Cheyenne Company has the following information for the current period: Beginning inventory - $ 1 0 8 0 0 0 Purchases - $ 1 1 4 0 0 0 0 Ending Inventory - $ 1 1 8 0 0 0 Accounts Payable - $ 5 0 5 4 0...
-
Use the summary statistics in Exercise 11 to test the null hypothesis H0: 1 = 0 versus H1: 1 0. Use the = 0.01 level of significance.
-
Zoso is a rental car company that is trying to determine whether to add 25 cars to its fleet. The company fully depreciates all its rental cars over five years using the straight-line method. The new...
-
nment: (40 points) Management has studied work patterns in the housekeeping department and estimates the number of hours to be worked as follows. Hours worked = (1,500 per month) + (0.50 X RVUS). For...
-
Food scientists have created a new oil. At room temperature, the oil is a liquid. As the oil gets colder however, it stiffens (thickens) into a sticky gel. To explore the properties of the oil, the...
-
In a distribution where the mean is 60 and the standard deviation is 5, find the largest fraction of the numbers that could meet the following requirements. less than 35 or more than 85 Of the...
-
If Andr invests $2,000 in 3 years time, and an additional $5,000 in 6 years time, how much will he have 8 years from today at an interest rate of 7%, compounded quarterly?
-
Gazpacho Foods LLC is considering a project that requires an investment of $31.000 and is estimated to provide the following cash flows: Year Cash Flows 1 $10,000 2 20,000 3 10,000 4 10,000 S 5,000...
-
2. There are two random variables X and Y. We know the following information: = 120 Var (2X + Y): Var (X2Y) = 240 Var (X) - Var(Y) = 20 (a) Compute Var(X). (b) Compute px,y = corr(X, Y).
-
-1-2i Divide: Write your answer in a + bi form -6-4i
-
A plane flying horizontally with a speed of 27.Om/s at a height of 175 m drops a package with it is directly over a tent. How far from the tent will the package land?
-
Let ABC be a triangle, and let D. E, and F be the points where the incircle is tangent to sides BC, CA and AB respectively. (a) (b) Prove that the cevians AD, BE and CF are concurrent using Ceva's...
-
A Bloomberg Businessweek subscriber study asked, In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often? A second question asked if the type of...
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
Deborah purchases a new $30,000 car in 2012 to use exclusively in her business. If Deborah does not elect to expense or take bonus depreciation in 2012 and holds the car until it is fully...
-
Mary paid $2,000 of state income taxes in 2012. The total sales tax she paid during 2012 was $5,500, which included $3,000 for the cost of a new car. How should Mary treat the taxes paid on her 2012...
-
Prove that van der Waals constants \((a, b)\) can be expressed in terms of critical temperature and pressure as follows: a = 27 R 2 T 2 c 64 P c b = R T c 8 P c a = 27 R 2 T c 2 64 P c b = R T c 8 P c
-
Justify the following statement with illustration: 'Violation of Kelvin-Planck statement leads to the violation of Clausius statement'.
-
Show that where \[ \left(\frac{\partial U}{\partial V} ight)_{T}=\frac{T \beta}{\kappa}-P \] \(\beta=\) Coefficient of volume expansion \(\kappa=\) Isothermal compressibility.
Study smarter with the SolutionInn App