subject
Computers and Technology, 08.11.2019 20:31 rina62

Java ap csa
lab assignment ab23.1
life
background:
the “game of life” is a computer simulation of the life and death events of a population of bacterial
organisms. this program will determine the life, death, and survival of bacteria from one generation to
the next, assuming the starting grid of bacteria is considered generation zero. the rules for the
creation of the next generation are as follows:
1. a “neighbor” of a cell is defined as any cell touching that cell. for example, the eight blue cells
in the diagram are the neighbors of the cell in the middle.
2. every empty cell with three living neighbors will come to life in the next generation (termed a
“birth”).
3. any cell with one or zero neighbors will die of loneliness, while any cell with four or more
neighbors will die from overcrowding (termed a “death”).
4. any cell with two or three neighbors will live into the next generation (no change).
5. all births and deaths occur simultaneously.
assignment:
1. write a program that implements the game of life. the size of the grid will be a square 20 x
20.
2. the original grid of bacteria will be supplied to your program from a text file (life100.txt).
a. the first line will contain the number (n) of bacteria locations in the file.
b. what follows are n pairs of data, one pair of numbers per line.
c. the first value of each line indicates the row location while the second value on the
line indicates the column location.
d. the data file values are given as: 1 < = row < = 20 and 1 < = col < = 20.
3. after your program has initialized the grid with generation 0, your program must allow life to
proceed for 5 generations.
4. display the final results on the screen and determine the following statistical information:
a. the number of living cells in row 10.
b. the number of living cells in column 10.
c. the number of living cells in the entire board.
instructions:
1. a sample run output is given below. note, these are the correct answers if you use the
provided data file "life100.txt".

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
question
Computers and Technology, 23.06.2019 20:10
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
You know the right answer?
Java ap csa
lab assignment ab23.1
life
background:
the “game of life” is a...
Questions
question
History, 28.01.2020 22:03
question
Mathematics, 28.01.2020 22:04
question
English, 28.01.2020 22:04
Questions on the website: 13722367