Create a class called CitizenRegister with the following attributes/variables: a. Node headNode b. int totalRegisteredCitizens Add and complete the following methods in CitizenRegister: a. head() i....


Can i get help with this singly linked list questiion and code, with user input, you can prompt and ask any question on the user input just so i can follow what's going on, thanks


language is java



java



java


Create a class called CitizenRegister with the following attributes/variables:<br>a. Node headNode<br>b. int totalRegisteredCitizens<br>Add and complete the following methods in CitizenRegister:<br>a. head()<br>i.<br>b. tail()<br>Returns the first citizen object in the linked list<br>i.<br>Returns the last citizen object in the linked list<br>c. size()<br>i.<br>Returns the totalRegisteredCitizen<br>d. isEmpty()<br>i.<br>e. addCitizenAtHead(Node newNode)<br>i. Adds a new node object containing the citizen object information<br>Returns the boolean of whether the linked list is empty or not<br>before the headNode<br>f. addCitizenAtTail(Node newNode)<br>i.<br>Adds a new node object containing the citizen object information at<br>the end of the linked list<br>

Extracted text: Create a class called CitizenRegister with the following attributes/variables: a. Node headNode b. int totalRegisteredCitizens Add and complete the following methods in CitizenRegister: a. head() i. b. tail() Returns the first citizen object in the linked list i. Returns the last citizen object in the linked list c. size() i. Returns the totalRegisteredCitizen d. isEmpty() i. e. addCitizenAtHead(Node newNode) i. Adds a new node object containing the citizen object information Returns the boolean of whether the linked list is empty or not before the headNode f. addCitizenAtTail(Node newNode) i. Adds a new node object containing the citizen object information at the end of the linked list
g. addCitizenBefore(String citizenlD, Node newNode)<br>i. Adds a new node object containing the citizen object information<br>before the node with the matching citizenID<br>If such citizen object isn't found display “Citizen has not registered for<br>i.<br>vaccine

Extracted text: g. addCitizenBefore(String citizenlD, Node newNode) i. Adds a new node object containing the citizen object information before the node with the matching citizenID If such citizen object isn't found display “Citizen has not registered for i. vaccine" and add the new node at the end of the linked list h. addCitizenAfter(String citizenID, Node newNode) i. Adds a new node object containing the citizen object information after the node with the matching citizenID ii. If such citizen object isn't found display "Citizen has not registered for vaccine" and add the new node at the end of the linked list i. removeCitizen(String citizenID) i. Deletes the node object containing the citizen object with the matching citizenID If such citizen object isn't found display “Citizen has not registered for ii. vaccine" j. removelastCitizen() i. Deletes the last node object containing the citizen object at the end of the linked list k. removeFirstCitizen() İ Deletes the first node object containing the citizen object in the linked list 1. displayAllCitizens()
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here