Question: If the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should

If the user tries to do an operation that could violate the

If the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should display an error message (e.g. adding a citizen twice to the list, etc.) Checking equality of any 2 objects should be done via the equals() method There is a class that will do the main job of the application as follows: Testing: It has one collection to store the whole data (all citizens) It has static methods, one for each operation happens frequently When you add a citizen to the list, a message should be displayed to the user to explain the status of the operation (i.e. if it was successful or not) After implementing the required classes, design and implement a testing class to test them as follows: Add at least 7 citizens to the collection that stores the whole data Add 1, 2 and 3 doses to different citizens and keep some citizens unvaccinated Try to violate the state of the objects and show that your code prevents all violations. Show that the other operations that happen frequently are working fine At the end, the whole data should be saved into a text file and this file should be saved automatically inside the folder contains your Java project

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 General Management Questions!