java Singly linked list need help with numbers 5 only 1 to 5 is done but they connected 5 is in the picture 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

java Singly linked list

need help with numbers 5 only 1 to 5 is done but they connected 5 is in the picture

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

 

N.B. "link" up the remaining linked list! (hints: operations defgh), the above operations
didn't cover all cases, think about what happens if the linked list is empty? What should your
as a programmer do?
Remember this is an OOP practical, all class variables MUST be private, use accessor and
mutators to read/write them, incorrect implementation will result in mark deduction.
5. Driver (the program that runs everything)
a. Create a menu system as shown below:
Welcome to the Covid vaccine registertration program.
Enter numbers for various menu options:
Show the first citizen registered
Show the last citizen registered
Show the total amount of citizen registered
Show whether the list is empty
Add a citizen in front of the list
Add a citizen at the end of the list
Add citizen before a given ID
Add citizen after a given ID
Remove citiven with the given ID
Remove last citizen
Remove first citizen
Show all citizens in the list
Any other integers to Quit.
10
11
12
13+
b. A follow-up menu should prompt the user to enter additional information for
options 5-8 e.g.
Enter citizen info in the folloing format:
citizentD, citizeE,citizersumame,citizencellmber,registrationDay,registrationonth,registrationrear
When the user enters invalid input (e.g. negative integers or integer values
outside the range of options 1- 12):
Terminate the program with the following message
Program terminated due to invalid input. Thanks for using our
systom
Transcribed Image Text:N.B. "link" up the remaining linked list! (hints: operations defgh), the above operations didn't cover all cases, think about what happens if the linked list is empty? What should your as a programmer do? Remember this is an OOP practical, all class variables MUST be private, use accessor and mutators to read/write them, incorrect implementation will result in mark deduction. 5. Driver (the program that runs everything) a. Create a menu system as shown below: Welcome to the Covid vaccine registertration program. Enter numbers for various menu options: Show the first citizen registered Show the last citizen registered Show the total amount of citizen registered Show whether the list is empty Add a citizen in front of the list Add a citizen at the end of the list Add citizen before a given ID Add citizen after a given ID Remove citiven with the given ID Remove last citizen Remove first citizen Show all citizens in the list Any other integers to Quit. 10 11 12 13+ b. A follow-up menu should prompt the user to enter additional information for options 5-8 e.g. Enter citizen info in the folloing format: citizentD, citizeE,citizersumame,citizencellmber,registrationDay,registrationonth,registrationrear When the user enters invalid input (e.g. negative integers or integer values outside the range of options 1- 12): Terminate the program with the following message Program terminated due to invalid input. Thanks for using our systom
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Operations of Linked List
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education