Create a class called CitizenRegister with the following attributes/variables: a. Node headNode b. int totalRegisteredCitizens

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
100%

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:
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
Transcribed Image 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)
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()
Transcribed Image 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()
Expert Solution
steps

Step by step

Solved in 2 steps

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