Small Java GUI Project Attached is the information for the Java GUI Project for you review and thoughts. Outbreak
Project Outcomes:
Develop a Java program that uses:
A Graphical User Interface (GUI)
Random numbers
Periodic updates using a Timer
Event-driven programming
Java Documentation
o Random: https://docs.oracle.com/javase/8/docs/api/java/util/Random.html
o Timer: https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html
o Swing/AWT features as needed
Background Information:
Project overview:
The Covid-19 virus is dominating every single one of our lives at the moment and needs no
introduction. New terms such as social-distancing are now fully ubiquitous in our everyday language.
Current recommendations are that people not get within six feet of each other.
Project Requirements:
Your application must function as described below:
1. A graphical interface component must be present to allow a user of the application to update
the percentage of the population complying with social distancing recommendations.
i.
Changes to the value should be reflected in the graphical simulation.
2. A display of color spots shall indicate the status of members of the population. Green for
healthy, red for infected and black for deceased. Optionally, add some additional indicator for
non-compliant persons. In the demo below, an orange outline is used.
3. The program must run in time steps indicating the effects of social distancing on the spread of
infectious diseases such as the Coronavirus.
i.
In each time step, every person (cell in the grid) should be analyzed and displayed
according to their status.
ii.
If the person has not yet been exposed to the virus, there is a 75% possibility that they
will contract the virus if they come into contact with an infected person.
a. Coming into contact means that one of the two people involved is not complying
with social distancing guidelines.
iii.
After four time steps an infected person should stop being contagious. The probability of
death should be set as 3%. The other 97% go back to a healthy state but will no longer
be vectors for the spread of the virus. This means that they will remain green for the
remainder of the program run and will not transmit the virus.
iv.
Choose 5% of the initial population at random to be infected.
Implementation Notes:
1. Create a project that is object oriented, therefore there should be several classes.
2. A Timer can be used to trigger an action to occur every X milliseconds. For example:
// Infector is a class that you need to define, which implements the ActionListener
interface
ActionListener infect = frame.new Infector(); // Infector is an inner class of the `frame`
object
// STEP_TIME, below, is the number of milliseconds between updates
Timer t = new Timer(STEP_TIME, infect);
// start the Timer. It will repeat every STEP_TIME milliseconds until stopped
t.start();
3. repaint() is needed inside a JComponent to re-draw the display after updating the data.
4. All of the % probabilities can be implemented using a Random object. Simply create a new
Random() instance at the start of your program and any time you need to check
against THRESHOLD %. For example, if the fatality rate is 3%, you can determine if a person dies
by running something like:
5. // start of application
6. Random percentageChecker = new Random();
7. // … someplace else, during timestep checks
8. // assume FATALITY_RATE is an integer set to 3
9. boolean deceased = percentageChecker.nextInt(100) < FATALITY_RATE;
10. // take action
Example App on next page
Purchase answer to see full
attachment
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.