Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following Covidvictim, Node and LinkedList ADTS: public class Covidvictim private String victimName private String caseid private int age private String clusterName // Teratai,
Given the following Covidvictim, Node and LinkedList ADTS: public class Covidvictim private String victimName private String caseid private int age private String clusterName // Teratai, Nibong & Lestari private String positiveDate // DDMMYYYY e.g 08112020 /* All the accessor methods */ public void displayVictim(); } class Node Covidvictim element; Node next public Node (Covidvictim element) {...} class Linkedlist! private Node first, last, current; public LinkedList() {...} public CovidVictim getNext() {...} public Covidvictim getFirst() {...} public Covidvictim getLast() {...) public Covidvictim removeFromBack() [...] public CovidVictim insertAt Front() {...} 1 Assumed all data have stored in a Linkedlist data structure named victimlL . Write a program segment to perform the followings: a) Find and display the detail of victims and the number of victims which were diagnosed positive covid for the fourth quarter of year 2020. (5 marks) b) Move all covid victims' which aged more than 50 years old from victimll into riskvictimel, while the others remain in victimll. (5 marks) c) Calculate and display the number of victims for each cluster from riskvictimll. The output should be displayed based on the format shown below: TOTAL VICTIMS FOR EACH CLUSTER Cluster No. of Victims XXXXX XXX (5 marks) Given the following Covidvictim, Node and LinkedList ADTS: public class Covidvictim private String victimName private String caseid private int age private String clusterName // Teratai, Nibong & Lestari private String positiveDate // DDMMYYYY e.g 08112020 /* All the accessor methods */ public void displayVictim(); } class Node Covidvictim element; Node next public Node (Covidvictim element) {...} class Linkedlist! private Node first, last, current; public LinkedList() {...} public CovidVictim getNext() {...} public Covidvictim getFirst() {...} public Covidvictim getLast() {...) public Covidvictim removeFromBack() [...] public CovidVictim insertAt Front() {...} 1 Assumed all data have stored in a Linkedlist data structure named victimlL . Write a program segment to perform the followings: a) Find and display the detail of victims and the number of victims which were diagnosed positive covid for the fourth quarter of year 2020. (5 marks) b) Move all covid victims' which aged more than 50 years old from victimll into riskvictimel, while the others remain in victimll. (5 marks) c) Calculate and display the number of victims for each cluster from riskvictimll. The output should be displayed based on the format shown below: TOTAL VICTIMS FOR EACH CLUSTER Cluster No. of Victims XXXXX XXX
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started