Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In java and please ASAP The current selected programming language is Java. We emphasize the submission of a fully working code over partially correct but
In java and please ASAP
The current selected programming language is Java. We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted, you cannot review this problem again. The version of 3DK being used is 1.8 There is a colony of 8 cells arranged in a straight line where each day every cell competes with its adjacent cells (neighbours) Each day, for each cell, if its neighbours are both active or both inactive, the cell becomes inactive the next day; otherwise it becomes active the next day Assumptions: The two cells on the ends have single adjacent cell, so the other adjacent cell can be assumed to be always inactive . Even after updating the cell state, consider its previous state for updating the . state of other cells. Update the cell information of all cells simultaneously Write a method cellCompete of class Colonywhich takes an 8 element array of integers cells representing the current state of 8 cells and an integer days representing the number of days to simulate. The function should return an array representing the state of the cells after the given number of days An integers value of 1 represents an active cell and value of O represents an inactive cell. TestCase 1: Input: l,o, 0, 0, 0, 1, o, 0], 1 Expected Return Value TestCase 2: Input: Expected Return Value 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