Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help within 1hours Part B : Debugging (1 hour) You are given a Java source code (TestPandemic.java) with errors (syntax errors and/or logical errors, if
help within 1hours
Part B : Debugging (1 hour) You are given a Java source code (TestPandemic.java) with errors (syntax errors and/or logical errors, if any) below: 1 2 3 4 class Year private String start Year; private String endYear; 6 public Year() + start Years endYear e: 1 publie String getStart Year () return startYear: 1 public String get End Year() {return endYear; } 1 Abstract class Pandemic Year publie Pandemic (Year y) 1 yeary: 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 publie abstract void report; } //abstract class class Malaria extends Pandemic i private int level; public Malaria (Year y, int i 1 sup (y) ; level-1: 1 public void report() System.out.println("Dispose mosquitoes for level" +getLevel() + " has begun+getStartYear()+" and has ended on + getEndYear()); 1 public int get Level() {return level; } 1 class Covid extends Pandemie ! private String vaccine; 39 40 41 42 43 44 public Covid(Year y, String v 1 super() vaccinev; 1 public void report () System.out.println("Reduce covid by getting +getVaccine ()+" will starts on getStartYear()+" and will end on "+ getEndYear()); > public String getVaccine 0 {return vaccine; 1 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 1 class PandemicExe extendsException private String magi PandemicExce) 1 mag- String ("Age -80 Need to check for availability!."); ? public String getMessage() return meg: 7 //PandemicException //DRIVER public class Test Pandemic2 public static void main(String[] args) { int-B9; int count: 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 try + if (a >80) throw PandemicExe(): 1 catch (PandemicExc) System.out.println(getMessage()); 1 Year Yeari new year ("1973","1980" ); Year year 2 new year ("2020", "2027" ); Pandemie pan = new Pandemiei pan[11- Malaria (yearl, 3); pan[2] - Covid (year 2, "Pfizer COVID-19"); 96 97 98 99 100 101 102 103 104 for(count-0;count=80 Need to check for availability!. Dispose mosquitoes for level 3 has begun 1973 and has ended on 1980 Reduce covid by getting Pfizer COVID-19 will starts on 2020 and will end on 2027 Figure 1: Output Pundemic Year -Year Year start Year String -End Year String Pandemic Year) report:void + getStart Year() Scriog +getEndDate(): String Malaria Covid level: Int -vaccine : String Malaria(Yearint) + gerLevelin + report:void A Covid(String. Year) + Ret Vaccinel): String + report:void Test PandemicStep 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