You were asked by a doctor friend to prepare for her a “Hospital simulator”, which can simulate the future patients’ state, based on their current state and a list of drugs they take. Patients can have one of these states:
In the “Hospital simulator” drugs are provided to all patients. It is not possible to target a specific patient. This is the list of available drugs:
Drugs can change patients’ states. They can cure, cause side effects or even kill a patient if not properly prescribed. Drugs effects are described by the following rules:
Parameter 1
Parameter 2
The result should be sent to stdout.
It should be a comma separated string with number of patients with a given state, following the format:
F:NP,H:NP,D:NP,T:NP,X:NP
Where:
Example 1
$ java -jar hospitalSimulatorProject-1.0-SNAPSHOT.jar "F,D,T,T" "P,An,I"
F:1,H:0,D:0,T:2,X:1
Example 2
$java -jar hospitalSimulatorProject-1.0-SNAPSHOT.jar F P
F:0,H:1,D:0,T:0,X:0
mvn clean install
java -jar hospitalSimulatorProject-1.0-SNAPSHOT.jar "D,D" ""
May 25, 2023 1:04:49 PM com.report.hospital.Main report
INFO: F:0,H:0,D:0,T:0,X:2
java -jar hospitalSimulatorProject-1.0-SNAPSHOT.jar "F" "P"
May 25, 2023 1:05:00 PM com.report.hospital.Main report
INFO: F:0,H:1,D:0,T:0,X:0
java -jar hospitalSimulatorProject-1.0-SNAPSHOT.jar "T,F,D" "An,I" May 25, 2023 1:05:10 PM com.report.hospital.Main report
INFO: F:2,H:0,D:1,T:0,X:0