Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java please. Corona ja Main.java Vijava OL public class Virus private String family: private String specios; private double ro; private ArrayList symptoms; public Virus()

in java please. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Corona ja Main.java Vijava OL public class Virus private String family: private String specios; private double ro; private ArrayList symptoms; public Virus() { this family: "", speciau **, O: 1.0, new ArrayList(); public Virus (String family, String species) this(fantly, species, r: 1.0, new ArrayListstring>():) public Virus(string fandly. String species, double ro) { this(family, species, re, new ArrayList0); } public Virus(String family, String species, ArrayList symptoms) (this(family, species, r: 1.0, symptoms); } public Virus(String family, String species, double ro, ArrayList symptoms) { this.fanily - family: this species = species; this. F = rW; this.symptoms = symptoms; } public void evolve(double newre, ArrayList newSymptoms) re = newRO: symptoms - newsymptoms; 11 public ArrayList getsymptoms() { return symptoms; public double getre() { return ro; } public String getFamily { return fanily: ) public void setFanily(String newFamily) { family = newFamily: public String getSpecies() { return species; } public void setSpecies(String newSpecies) { species = newSpecies; > I Task 2.3 There is some code written in Main.java . In Corona.java , modify and add everything needed to make the errors in main() disappear. Do not change the code in main() or Virus.java. The output should also correctly validate upon checking your answer. Hint > Make use of super and this where required and in places they may be useful (for example: constructor chaining). You only need to define as many constructors as are necessary to remove the errors, you can keep the default constructor. If you choose to define any methods in Corona.java, they must be private. d super 2.3 src Corona c Corona.java Main.java Virus.java 2 related problems 1 public class Corona extends Virus 2 3 private double mortRate; 4 private int yearof Emergence 5 6 7 8 9 * Default constructor for a Corona. */ 2 related problems public Corona() { super( family: "coronavirus", species: "COVID-62"); mortRate = 0.005; yearofEmergence = 2002; } 10 011 12 13 14 orona.Java Main.java Virus.java simport java.util.ArrayList; Cimport java.util.Arrays; public class Maint public static void main(String[] args) { // fix this! Corona ci = new Corona 0.00 2819 2252 new ArrayListCarrays, aslist sniffles". fever", "cough", "shortness of breath")) Corona c2 = new Corona 0.3 2014 new ArrayList Arrays, aslistfever, cough", "shortness of breath")) // for validation System.out.println(ci.getSpecies()); System.out.println(c2.getSpecies()); } )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

What is the difference between R2 and adjusted R2?

Answered: 1 week ago

Question

How can the acceptability of policy measures be increased?

Answered: 1 week ago

Question

3. You can gain power by making others feel important.

Answered: 1 week ago