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
-
Patrick Innes has a business that he estimates will produce income of $130,000 per year. If he incorporates this business in 2020, all of the income would be eligible for the small business deduction...
-
Dean has been working on a project for six months, though he is not a permanent employee of the companyhe is a contract employee provided by a vendor. What contract vehicle makes the most sense to...
-
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...
-
During the mixing of a primary or secondary alcohol with Chromic Anhydride Reagent, the following change occurs (equation unbalanced): CrO3(aq) + H2SO4(aq) Cr2(SO4)3(s) i. What kind of reaction has...
-
The objective function of the BONDS model is given in terms of the horizon value of the portfolio. Suppose that we wish to reformulate the model in terms of the interest income and capital gains in...
-
Investment professionals frequently develop concerns that earnings management may be present when they observe that a firm has voluntarily changed its inventory valuation policy from LIFO to FIFO....
-
The following auditors report was drafted by a staff accountant of Turner & Turner, CPAs, at the completion of the audit of the financial statements of Lyon Computers, Inc. (a non-public company) for...
-
An affidavit-complaint for disbarment for gross ignorance of the law and for grave abuse of discretion and authority against the chair of the Commission on Audit was lodged before the Supreme Court...
-
Suppose that Coke and Pepsi are fighting for the cola market. Each week each person in the market buys one case of Coke or Pepsi. If the persons last purchase was Coke, there is a 0.90 probability...
-
1. The ratio of height and depth from Earth's surface where acceleration due to gravity is , is 2. (1) (2/2+2) (2) (12-1) (3) (V2-1) (4) (2/2-2)
-
An investor is faced with a market portfolio with an expected return of 15%, a risk free rate of 5%, and a standard deviation of market returns of 20%. a) What combination of the market portfolio and...
-
You have been asked to evaluate an infinitely lived project. Sales in the first year are projected to be $100. Costs are projected at $50. There is no depreciation, and the tax rate is 30%. The real...
-
find the correct Market Implied cost of capital (ROE) in excel using the solver function with the data given below Stock Valuation: 10-Period Growth Model 3.21% Long run dividend growth rate 12.33%...
-
Compromised need is part of Robert Taylor s definition of Information Need in his 1 9 6 2 work The Process of asking a Question . Define this term and then discuss the importance of this feature of...
-
For each of the following, compute the future value: Note: Do not round intermediate calculations and round your answers to 2 decimal places, e.g., 32.16. $ ed Present Value Years Interest Rate...
-
A company has determined the following standards for production of its dining tables: Square feet of oak per table: 16 Price per square foot of oak: $4.00 Number of screws per table: 22 Price per...
-
The Smiths buy a house. They borrow 80 percent of the purchase price from the local ABC Savings and Loan. Before they make their first payment, ABC transfers the right to receive mortgage payments to...
-
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...
-
Starbucks Corporation and PepsiCo formed a joint venture to produce and distribute Starbucks bottled Frappuccino coffee drink throughout North America. Assume that the 50/50 joint venture had a book...
-
Tim Propp, CFO of Thunderbird, Inc., invested some of the firms excess cash in the common shares of what he thought were three undervalued securities. At year-end he reviewed how the portfolio of...
-
Among the various responsibilities of the Chief Financial Officer (CFO) of the Amphlett Corporation was the management and oversight of the firms cash reserves. During the year, the CFO had invested...
Study smarter with the SolutionInn App