Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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?

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions