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 - Create a class called Node with the following attributes/variables: a. Citizen citizen b. Node nextNode - 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. 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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

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
- Create a class called Node with the following attributes/variables:
a. Citizen citizen
b. Node nextNode
- 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. 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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,