java Singly linked list 1. Create a class called Citizen with the following attributes/variables:a. String citizenIDb. String citizenNamec. String citizenSurnamed. String citizenCellNumbere. int registrationDayf. int registrationMonthg. int registrationYear2. Create a class called Node with the following attributes/variables:a. Citizen citizen b. Node nextNode 3. Create a class called CitizenRegister with the following attributes/variables:a. Node headNodeb. int totalRegisteredCitizens4. Add and complete the following methods in CitizenRegister:a. head()i. Returns the first citizen object in the linked listb. tail()i. Returns the last citizen object in the linked listc. size()i. Returns the totalRegisteredCitizend. isEmpty()i. Returns the boolean of whether the linked list is empty or note. addCitizenAtHead(Node newNode)i. Adds a new node object containing the citizen object information before the headNodef. addCitizenAtTail(Node newNode)i. Adds a new node object containing the citizen object information at the end of the linked listg. addCitizenBefore(String citizenID, Node newNode)i. Adds a new node object containing the citizen object information before the node with the matching citizenIDii. 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 listh. addCitizenAfter(String citizenID, Node newNode)i. Adds a new node object containing the citizen object information after the node with the matching citizenIDii. 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 listi. removeCitizen(String citizenID)i. Deletes the node object containing the citizen object with the matching citizenIDii. If such citizen object isn’t found display “Citizen has not registered for vaccine” j. removeLastCitizen() i. Deletes the last node object containing the citizen object at the end of the linked listk. removeFirstCitizen()i. Deletes the first node object containing the citizen object in the linked listl. displayAllCitizens()Print the name and surname of all the citizens in the linked list in neatly formatted output:citizenNumber 007citizenName citizenSurname James Bond

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

java Singly linked list

1. Create a class called Citizen with the following attributes/variables:
a. String citizenID
b. String citizenName
c. String citizenSurname
d. String citizenCellNumber
e. int registrationDay
f. int registrationMonth
g. int registrationYear
2. Create a class called Node with the following attributes/variables:
a. Citizen citizen 
b. Node nextNode 
3. Create a class called CitizenRegister with the following attributes/variables:
a. Node headNode
b. int totalRegisteredCitizens
4. Add and complete the following methods in CitizenRegister:
a. head()
i. Returns the first citizen object in the linked list
b. tail()
i. Returns the last citizen object in the linked list
c. size()
i. Returns the totalRegisteredCitizen
d. isEmpty()
i. Returns the boolean of whether the linked list is empty or not
e. addCitizenAtHead(Node newNode)
i. Adds a new node object containing the citizen object information 
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 citizenID, Node newNode)
i. Adds a new node object containing the citizen object information 
before 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
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
ii. If such citizen object isn’t found display “Citizen has not registered for 
vaccine” 
j. removeLastCitizen() 
i. Deletes the last node object containing the citizen object at the end 
of the linked list
k. removeFirstCitizen()
i. Deletes the first node object containing the citizen object in the linked 
list
l. displayAllCitizens()
Print the name and surname of all the citizens in the linked list in 
neatly formatted output:
citizenNumber 007
citizenName citizenSurname James Bond

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY