Input to the program has the form where the first line indicates how many days they will do the operation. For each day, the input starts with the day number, along with the following patient list where each element represents the name of patients and the age.  The input ends with the number of available testing kits. The output display, at each midnight, who are going to be tested for the next day.   You could use LinkedList which you used in the previous question when new patients come and go. You could use Comparator to compare the age of people. You could use Collections.sort() to sort all people by their age.  Once you sort them out, please select a few people depending on the number of available testing kits.  So please writhe the pseudo code (or you can write in Java code and submit the Java file with its output).   Input : 3 Day1, (Andrew, 19) (Tom, 69) (Elly, 59) (Tin, 55) (Bob, 29), Available Testing Kit of 1 units Day2, (Andy, 44) (Bobby, 88) (Joe, 9) (Trump, 78), Available Testing Kit of 2 units Day3, (Sally, 10), Available Testing Kit of 3 units

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

Sorting objects in the real world https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html

There are 5000 people living in the town. Every day they have  new COVID-19 cases.

When people show symptom, they go to the hospital and put themselves in the waiting list for testing. A new person is added at the end of the list.  Due to the lack of testing kit, all in the list cannot be tested. Hospital has to sort them and select a few. Since the elderly is very weak to the COVID-19, every midnight the doctors sort the people in the list by their age to decide who is taking the test for the next day depending on the availability of testing kit.

Input to the program has the form where the first line indicates how many days they will do the operation. For each day, the input starts with the day number, along with the following patient list where each element represents the name of patients and the age.  The input ends with the number of available testing kits.

The output display, at each midnight, who are going to be tested for the next day.  

You could use LinkedList which you used in the previous question when new patients come and go. You could use Comparator to compare the age of people. You could use Collections.sort() to sort all people by their age.  Once you sort them out, please select a few people depending on the number of available testing kits. 

So please writhe the pseudo code (or you can write in Java code and submit the Java file with its output).  

Input :

  • 3
  • Day1, (Andrew, 19) (Tom, 69) (Elly, 59) (Tin, 55) (Bob, 29), Available Testing Kit of 1 units
  • Day2, (Andy, 44) (Bobby, 88) (Joe, 9) (Trump, 78), Available Testing Kit of 2 units
  • Day3, (Sally, 10), Available Testing Kit of 3 units
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Time complexity
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