school/java/final-project/CovidManager.java

61 lines
1.7 KiB
Java
Raw Normal View History

2021-04-08 14:23:01 -04:00
import java.util.ArrayList;
//time 11:10 - 11:22
2021-04-08 16:13:03 -04:00
//time 12:00 - 16:10
2021-04-08 14:23:01 -04:00
//time1 - 10:10 10:30
2021-04-02 15:29:34 -04:00
public class CovidManager {
public static void main( String[] args){
CovidEntry covidObject =
new CovidEntry("TX",
4, 12,
233343,
5,
10,
15);
System.out.println(covidObject);
CovidDatabase db = new CovidDatabase();
db.readCovidData("data/covid_data.csv");
2021-04-08 14:23:01 -04:00
System.out.println("highest daily d for texas");
CovidEntry highestTX = db.peakDailyDeaths("TX");
System.out.println(highestTX);
ArrayList<CovidEntry> may5th = db.getDailyDeaths(5, 5);
System.out.println("May 5th Data");
for (CovidEntry c: may5th){
System.out.println(c);
}
int totalInfections = db.getTotalInfections();
System.out.println("Total Infections " + totalInfections);
System.out.println("Total Records: " + db.countRecords());
System.out.println("Total Deaths: " + db.getTotalDeaths());
System.out.println("Total Deaths for May 5th: " + db.countTotalDeaths(5, 5));
System.out.println("Peak deaths for May 5th: " + db.peakDailyDeaths(5, 5));
System.out.println("Most total deaths: " + db.mostTotalDeaths() + " Total: " +
db.mostTotalDeaths().getTotalDeaths());
System.out.println("States with less than 300 infections on may 5th: ");
may5th = db.listMinimumDailyInfections(5, 5, 300);
for (CovidEntry c: may5th){
System.out.println(c);
}
2021-04-08 16:13:03 -04:00
System.out.println("WA safe to open: ");
ArrayList<CovidEntry> WASafe = db.safeToOpen("WA");
for (CovidEntry c: WASafe){
System.out.println(c);
}
System.out.println("Top 10 deaths for May 1st");
ArrayList<CovidEntry> topTenDeaths = db.topTenDeaths(5, 1);
for (CovidEntry c: topTenDeaths){
2021-04-08 14:23:01 -04:00
System.out.println(c);
}
2021-04-02 15:29:34 -04:00
}
}