The world has had to live with the Covid-19 pandemic for nearly two years. It has had a devastating effect on our lives and has changed the way we have had to work, live and interact with others. Fortunately, vaccines for Covid-19 have been developed to curb its spread and protect our health. Consider that you work in the Department of Health for the Government of South Africa. Your job is to manage the registration of citizens for Covid-19 vaccination. Please note that you are provided with template (code) files, which are Citizen.java, CitizenRegister.java, Node.java; students are expected to use these files to aid with this question.

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

The world has had to live with the Covid-19 pandemic for nearly two years. It has had a
devastating effect on our lives and has changed the way we have had to work, live and
interact with others. Fortunately, vaccines for Covid-19 have been developed to curb its
spread and protect our health. Consider that you work in the Department of Health for the
Government of South Africa. Your job is to manage the registration of citizens for Covid-19
vaccination.
Please note that you are provided with template (code) files, which are Citizen.java,
CitizenRegister.java, Node.java; students are expected to use these files to aid with this
question.
Your task is as follows:
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 d e f g h), the above operations
didn’t cover all cases, think about what happens if the linked list is empty? What should you
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:
b. A follow-up menu should prompt the user to enter additional information for
options 5-8 e.g.
c. When the user enters invalid input (e.g., negative integers or integer values
outside the range of options 1- 12):
i. Terminate the program with the following message
“Program terminated due to invalid input. Thanks for using our
system.”

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