Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My matrix is 7 x 7. Here is my idea for checking the corners, but I'm stuck on the edges. Am I on the right
My matrix is 7 x 7. Here is my idea for checking the corners, but I'm stuck on the edges. Am I on the right track?
You will need to declare and define a function spread the disease across the region. For each 's' in the current day the function should examine the surrounding 8, 5, or 3 slots (depending on if the 's' is irn the middle of the array, on a border, or in a corner respectively) and if any of the surrounding slots contain an 'i', the position of the examined 's' should be set to 'i' in next day's array. By updating using two arrays this prevent accidental infecting of people who are not near any infectious people (i) today, but will be tomorrow.. o o o It should have two, two-dimensional char arrays and an integer as its parameters. It should not return a value. Make sure you perform correct bounds checking on the arrays
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started