Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

CONTAGIOUS DISEASE SIMULATION

  • Posted
  • Authoradmin
  • Length217 words
  • Reading time1 min
Write My Assignment FREE

CONTAGIOUS DISEASE SIMULATION

In this take-home exam, your task is to simulate the contagion process of an infectious disease. The environment will be provided as a 10×10 grid. Each cell of the grid will contain one of the characters ‘H’, ‘I’, and ‘-‘, where ‘H’ stands for a healthy, ‘I’ for an infected person. ‘-‘ means that this cell is not occupied by any person; in other words, it is empty.

In each step of the simulation (for each generation), an infected person will infect all of his/her nearby healthy people. They can only infect through the directions of up, down, right, and left. Diagonal infection is not possible.

The number of simulation steps is going to be provided as an input, and you will run the simulation accordingly. You will print the state of the grid after the last simulation step has completed.

While you are computing the next generation, you will consider only the state of the PREVIOUS generation.

INPUT FORMAT:

After each row of the grid, a new line ‘n’ character will be given. After reading the grid, you should read the number of simulations from the input.

The post CONTAGIOUS DISEASE SIMULATION appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order