Question: In Java. Can you show the PersonTester code that meets the checklist : Make sure that die() applied to a dead person doesnt cause the

 In Java. Can you show the PersonTester code that meets the

In Java.

Can you show the PersonTester code that meets the checklist :

Make sure that die() applied to a dead person doesnt cause the population to decrease.

Make sure that a persons murderers name prints correctly if the murderer herself is dead.

Make sure that murdering a living person causes them to die.

Decide what happens when either a murderer or a victim is already dead.

Persons Implement a Person class that has all of the methods shown in Figure ?? Implement a peraontester class whose pub1ec atatic void nain () method uses the Person class methods to test the dass and simultaneously tells a story. The allsayle11o static member function should cause every currently living person to say hello. The tricky part of this is finding all of the currently living penons. To accomplish this use static member variable(s) to keep track of living people, and ensure that these variable(s) are updated by appropriate non-static functions. One technique is to use a member variable like private atatic ArrayL1at Peraon> thePeople; Another is to use a class like class Perboalink f private Person nyPerson private Personlink next : ... and a static member variable of type Personlink. Choose whatever you are comfortable with. Additional Coding Requirements All member variables must be privata. The public methods of the Person class must be exactly those described in Figure n. You may add as many private methods and fields as you see fit. The PersenTester class must contain a pub1te atatie void nainO method that runs your program. Content is otherwise up to you. constructurs pub1ic Persen(String n) Creates a living person with name n. attributies public Person nurderer O Returns the Person that murdered this person. Returns nu11 if this person has not been murdered. public string name O Returns this person's name. Should end with ", deceased" if the person is dead. public boolean ishliveO obvious. actions public void die(O Causes this Person to die, unless they are already dead, when it has no effect. public void murder (Person victin) Causes victin to die, and the murderer to be known to the victim. public void saykelloo causes this Person to print "Hello, I'm nase." on Syaten.out. cless attributes public statie int nurberliving O public atatic int nurberbead() class actions public static void al1SayHel1oO causes every living person to say hello as described above. Checklist Here are some things to check. - Make sure that die() applied to a dead person doesn't cause the population to decrease. - Make sure that a person's munderer's name prints correctly if the murderer herself is dead. - Make sure that murdering a living person causes them to die. - Decide what happens when either a murderer or a viktim is already dead

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!