Question: java language Concept Application & Algorithmic Part Question 1: (20 points) 1. Concept Application: A COVID 19 vaccination clinic allows the patients to receive the
java language







Concept Application & Algorithmic Part Question 1: (20 points) 1. Concept Application: A COVID 19 vaccination clinic allows the patients to receive the vaccine if they are 15 years old or above. Below is a linked list that contains patients' information. Write the steps needed to delete the patients who are under the allowed age for receiving the vaccine. Your answer must indicate: The position of the pointer and How the linked list looks after every step. Head ID: 643574 age:13 VacStatus: unvaccinated ID: 643574 age:25 VacStatus: unvaccinated ID: 643574 age:15 VacStatus: unvaccinated Null + ID: 643574 age:30 VacStatus: Vaccinated ID: 643574 age:55 VacStatus: Vaccinated ID: 643574 age:14 VacStatus: unvaccinated Question 3: (20 points) 2. Algorithm Write up: In the same vaccination clinic system, there is a linked list which contains all the registered patients. Write an algorithm that searches the linked list for patients who received the second dose of the vaccine and stores them in a new linked list. Head ID: 64300 VacStatus: Vaccinated Dose_1:0 Dose_2:0 ID: 54637 VacStatus: Vaccinated Dose_1:1 Dose_2:0 ID: 85746 VacStatus: Vaccinated Dose 1:0 Dose_2:0 Null Next ID: 43545 VacStatus: Vaccinated Dose_1:0 Dose_2:0 ID: 23234 VacStatus: Vaccinated Dose_1:1 Dose_2:1 ID: 65455 VacStatus: Vaccinated Dose_1:1 Dose_2:1 The output of the algorithm should print The patients who received the second dose of the vaccine are: 1. ID: 23234, VacStatus: Vaccinated, Dose 1:1, Dose 2:1 2. ID: 65455, VacStatus: Vaccinated, Dose_1:1, Dose_2:1 Algorithm Input: The patients list Output: Display a list of the patients who received the second dose of the vaccine or display an appropriate message if no patient who took the second dose are found Method: Question 3: (60 points) Program 3: COVID19 Vaccine program Objective 1. The primary objective of this program is to implement a linked list. 2. The secondary objective is to practice with File 1/0 and arrays. Program Description You are a Java programmer in the National Vaccination Department. They asked you create a program that manages and tracks the information of COVID19 vaccine cases in Saudi Arabia. Your program should be able to store an unlimited number of patients along with their basic personal information (ID, first name, last name, age, gender, phone, city, status, dosel, dose2). Your COVID19 Vaccine program will read a series of commands from an input file (input.in), such as ADD PATIENT, UPDATE_VACCINE, FIND_By_NAME, etc. You will need to process the commands and print the appropriate information to an output file (output.out). Implementation Your program has two linked lists. The first linked list called COVID19Vaccine Records, and it stores all patients' records. When the patient registers in the program, the default status will be Unvaccinated. Whenever the patient receives the first dose of the vaccine, the patient's status must be updated to be vaccinated. The second linked list is called CitiesList, and it is a list of cities in Saudi Arabia. It will allow you to keep a record of the total number of unvaccinated and vaccinated cases in each city (i.e., Jeddah, Makkah, Riyadh, etc.) Input/output Specifications The input file will be called "input.in". The first line of the file will be an integer, k, indicating the number of commands that will be run on the program. The following k lines will each be a single command, with its relevant data on the same line, separated by spaces. The commands you will have to implement are as follows: ADD_PATIENT - Creates a new patient record (a new node). The command will be followed by the following information: ID (a non-negative int), first and last name, gender (a character type (F/M)), age (a non-negative int), phone (a non-negative int), city (String), status (Unvaccinated\Vaccinated enum). If this patient is not already stored in the system, it should be added to the linked list. Otherwise, an error should be printed (See output file for details). Additionally, after the patient is added to the system, that patient's city should be inserted into the linked list of CitiesList. If the city is already on the list, you should not add the city node. Instead, you should update (increment) the number of unvaccinated total cases in that city. UPDATE_VACCINE - used to update the status of the patient's vaccine. This command is followed by the following information: ID (a non-negative int patient ID), dosel(String), or dose2(String). If the patient is already stored in the system, you should update the status from unvaccinated to vaccinated. Also, you should check if the patient receives the first or the second dose (See output file for details). If no matching patient record is found, an error message should be printed (See output file for details). Also, the unvaccinated and vaccinated cases in the patient's city should be updated (decrement the total unvaccinated cases and increment the total vaccinated cases). FIND_BY_NAME - This command will be followed by a name, first, then last. You must search the system to find the given name and then print out the patient information (See output file for details). If there was no match your program should print an error message saying that the patient has not been found (See output file for details). FIND_BY_ID - Similar to FIND_BY_NAME, this command will find a person based on his/her ID number instead. The output should include his/her information (See output file for details). If there was no match, your program should print an error message saying (See output file for details). DELETE_PATIENT - This command is used to delete the patient record from the system. This command will be followed by two Strings, the first name and last name of the record to be deleted. If the patient record is not found, an error message should be printed. If the patient's record shows that he/she got one or two doses of the vaccine, a message should be printed stating the patient has already received the vaccine and can't be deleted. Otherwise, the patient record should be deleted as well as the total of the unvaccinated patients in the patient's city should be updated (decremented), and an appropriate message printed (See output file for details). PRINT_RECORD - This command is followed by two Strings, the first and last name of the patient record you wish to print. If the record is not found, an error message should be printed. Otherwise, the record should be printed, including all the patient information and vaccination status (See output file for details). PRINT_CITY - This command prints the number of patients (unvaccinated, vaccinated) in each city. PRINT_ALL - This command prints all patients information. (See output file for details). See the sample input and output files (posted on the Blackboard) for examples ***WARNING*** Your program MUST adhere to this EXACT format (spacing, capitalization, use of colons, periods, punctuation, etc.). The graders will use very large input files, resulting in very large output files. As such, the graders will use text comparison programs to compare your output to the correct output. If, for example, you have two spaces between the outputs when there should be only one space, this will show up as an error even though you may have the program correct. You WILL get points off if this is the case, which is why this is being explained in detail. A minimum deduction will be 10% of the grade, as the graders will be forced to go to the text editing of your program in order to give you an accurate grade. UML Diagrams: Here are the UML Diagrams for the required classes: Patient Data Members COVID19VaccineRecords Data Members private Patient headL; Operations/Methods public class Patient private int id; private String [Name; private String lName; private char gender; private int age; private int phone; private String city; private statusType status: private int dose_1: private int dose_2; public Patient next; Operations/Methods public COVID19VaccineRecords (//one or more Constructors public void insert Patient() public void insert Patient() public int updatePatientVac (1) public patient searchPatientByName() public patient searchPatientById() public voidprintA110) public patient (// one or more Constructors public void print Patient() And any other methods you need. And any other methods you need. CityNode Data Members CitiesList Data Members private CityNode head; public class CityNode ! private String cityName; private int unvaccinatedCases; private int vaccinatedCases; public CityNode next; Operations/Methods Operations/Methods public CityNode () //one or more Constructors public int get UnvaccinatedCases) public void setUnvaccinatedCases (int unvaccinatedCases) public int getVaccinatedCases() public void setVaccinatedCases (int vaccinatedCases) public void insertCity (String city) public void updateUnvaccinatedCases () public CitiesList() // one or more Constructors public void insertCity () public CityNode findCity (String city) public void printCity (String city, String status) public void updateUnvacCases (String city, int unvaccinated) public void updateVacCases (String city, int vaccinated) updateunvaccinatedCases () updateVaccinatedCases() And any other methods you need. And any other methods you need. COVID19Vaccine Program Operations/Methods public static void main(String[] args) A Final suggestion: START EARLY Concept Application & Algorithmic Part Question 1: (20 points) 1. Concept Application: A COVID 19 vaccination clinic allows the patients to receive the vaccine if they are 15 years old or above. Below is a linked list that contains patients' information. Write the steps needed to delete the patients who are under the allowed age for receiving the vaccine. Your answer must indicate: The position of the pointer and How the linked list looks after every step. Head ID: 643574 age:13 VacStatus: unvaccinated ID: 643574 age:25 VacStatus: unvaccinated ID: 643574 age:15 VacStatus: unvaccinated Null + ID: 643574 age:30 VacStatus: Vaccinated ID: 643574 age:55 VacStatus: Vaccinated ID: 643574 age:14 VacStatus: unvaccinated Question 3: (20 points) 2. Algorithm Write up: In the same vaccination clinic system, there is a linked list which contains all the registered patients. Write an algorithm that searches the linked list for patients who received the second dose of the vaccine and stores them in a new linked list. Head ID: 64300 VacStatus: Vaccinated Dose_1:0 Dose_2:0 ID: 54637 VacStatus: Vaccinated Dose_1:1 Dose_2:0 ID: 85746 VacStatus: Vaccinated Dose 1:0 Dose_2:0 Null Next ID: 43545 VacStatus: Vaccinated Dose_1:0 Dose_2:0 ID: 23234 VacStatus: Vaccinated Dose_1:1 Dose_2:1 ID: 65455 VacStatus: Vaccinated Dose_1:1 Dose_2:1 The output of the algorithm should print The patients who received the second dose of the vaccine are: 1. ID: 23234, VacStatus: Vaccinated, Dose 1:1, Dose 2:1 2. ID: 65455, VacStatus: Vaccinated, Dose_1:1, Dose_2:1 Algorithm Input: The patients list Output: Display a list of the patients who received the second dose of the vaccine or display an appropriate message if no patient who took the second dose are found Method: Question 3: (60 points) Program 3: COVID19 Vaccine program Objective 1. The primary objective of this program is to implement a linked list. 2. The secondary objective is to practice with File 1/0 and arrays. Program Description You are a Java programmer in the National Vaccination Department. They asked you create a program that manages and tracks the information of COVID19 vaccine cases in Saudi Arabia. Your program should be able to store an unlimited number of patients along with their basic personal information (ID, first name, last name, age, gender, phone, city, status, dosel, dose2). Your COVID19 Vaccine program will read a series of commands from an input file (input.in), such as ADD PATIENT, UPDATE_VACCINE, FIND_By_NAME, etc. You will need to process the commands and print the appropriate information to an output file (output.out). Implementation Your program has two linked lists. The first linked list called COVID19Vaccine Records, and it stores all patients' records. When the patient registers in the program, the default status will be Unvaccinated. Whenever the patient receives the first dose of the vaccine, the patient's status must be updated to be vaccinated. The second linked list is called CitiesList, and it is a list of cities in Saudi Arabia. It will allow you to keep a record of the total number of unvaccinated and vaccinated cases in each city (i.e., Jeddah, Makkah, Riyadh, etc.) Input/output Specifications The input file will be called "input.in". The first line of the file will be an integer, k, indicating the number of commands that will be run on the program. The following k lines will each be a single command, with its relevant data on the same line, separated by spaces. The commands you will have to implement are as follows: ADD_PATIENT - Creates a new patient record (a new node). The command will be followed by the following information: ID (a non-negative int), first and last name, gender (a character type (F/M)), age (a non-negative int), phone (a non-negative int), city (String), status (Unvaccinated\Vaccinated enum). If this patient is not already stored in the system, it should be added to the linked list. Otherwise, an error should be printed (See output file for details). Additionally, after the patient is added to the system, that patient's city should be inserted into the linked list of CitiesList. If the city is already on the list, you should not add the city node. Instead, you should update (increment) the number of unvaccinated total cases in that city. UPDATE_VACCINE - used to update the status of the patient's vaccine. This command is followed by the following information: ID (a non-negative int patient ID), dosel(String), or dose2(String). If the patient is already stored in the system, you should update the status from unvaccinated to vaccinated. Also, you should check if the patient receives the first or the second dose (See output file for details). If no matching patient record is found, an error message should be printed (See output file for details). Also, the unvaccinated and vaccinated cases in the patient's city should be updated (decrement the total unvaccinated cases and increment the total vaccinated cases). FIND_BY_NAME - This command will be followed by a name, first, then last. You must search the system to find the given name and then print out the patient information (See output file for details). If there was no match your program should print an error message saying that the patient has not been found (See output file for details). FIND_BY_ID - Similar to FIND_BY_NAME, this command will find a person based on his/her ID number instead. The output should include his/her information (See output file for details). If there was no match, your program should print an error message saying (See output file for details). DELETE_PATIENT - This command is used to delete the patient record from the system. This command will be followed by two Strings, the first name and last name of the record to be deleted. If the patient record is not found, an error message should be printed. If the patient's record shows that he/she got one or two doses of the vaccine, a message should be printed stating the patient has already received the vaccine and can't be deleted. Otherwise, the patient record should be deleted as well as the total of the unvaccinated patients in the patient's city should be updated (decremented), and an appropriate message printed (See output file for details). PRINT_RECORD - This command is followed by two Strings, the first and last name of the patient record you wish to print. If the record is not found, an error message should be printed. Otherwise, the record should be printed, including all the patient information and vaccination status (See output file for details). PRINT_CITY - This command prints the number of patients (unvaccinated, vaccinated) in each city. PRINT_ALL - This command prints all patients information. (See output file for details). See the sample input and output files (posted on the Blackboard) for examples ***WARNING*** Your program MUST adhere to this EXACT format (spacing, capitalization, use of colons, periods, punctuation, etc.). The graders will use very large input files, resulting in very large output files. As such, the graders will use text comparison programs to compare your output to the correct output. If, for example, you have two spaces between the outputs when there should be only one space, this will show up as an error even though you may have the program correct. You WILL get points off if this is the case, which is why this is being explained in detail. A minimum deduction will be 10% of the grade, as the graders will be forced to go to the text editing of your program in order to give you an accurate grade. UML Diagrams: Here are the UML Diagrams for the required classes: Patient Data Members COVID19VaccineRecords Data Members private Patient headL; Operations/Methods public class Patient private int id; private String [Name; private String lName; private char gender; private int age; private int phone; private String city; private statusType status: private int dose_1: private int dose_2; public Patient next; Operations/Methods public COVID19VaccineRecords (//one or more Constructors public void insert Patient() public void insert Patient() public int updatePatientVac (1) public patient searchPatientByName() public patient searchPatientById() public voidprintA110) public patient (// one or more Constructors public void print Patient() And any other methods you need. And any other methods you need. CityNode Data Members CitiesList Data Members private CityNode head; public class CityNode ! private String cityName; private int unvaccinatedCases; private int vaccinatedCases; public CityNode next; Operations/Methods Operations/Methods public CityNode () //one or more Constructors public int get UnvaccinatedCases) public void setUnvaccinatedCases (int unvaccinatedCases) public int getVaccinatedCases() public void setVaccinatedCases (int vaccinatedCases) public void insertCity (String city) public void updateUnvaccinatedCases () public CitiesList() // one or more Constructors public void insertCity () public CityNode findCity (String city) public void printCity (String city, String status) public void updateUnvacCases (String city, int unvaccinated) public void updateVacCases (String city, int vaccinated) updateunvaccinatedCases () updateVaccinatedCases() And any other methods you need. And any other methods you need. COVID19Vaccine Program Operations/Methods public static void main(String[] args) A Final suggestion: START EARLY
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
