subject

Java Program Assignment: Read in the size of an array from the user, then read in initial values into that array, accepting ONLY zeros and ones. To be more precise, any number not a zero should
be entered into the array as a one. Now proceed through 20 steps of a “cellular automata”,
where the rule to create one stage from the previous is:
1) If a cell has a "1" in it, and it is surrounded by two other "1"s, it dies (becomes a zero)
due to overcrowding.
2) If a cell has a “0” in it, and it is surrounded by two other "1Is, a new “1” is born there (as
a child of the two "1"s.
3) If a cell has a "1" in it, but is surrounded by zeros, it dies from starvation (or loneliness).
4) If a cell has a "0" in it, and one of its adjacent cells has a "1", then it becomes a “1” (think
of the spread of mold, or an increase in population of an animal).
5) If none of the rules above apply, the cell remains as it was.
6) Edge cells (the ones at the ends of the array) are treated as if the "missing" cell was a
zero.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Ahorse is how much percent more powerful than a pony
Answers: 1
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
You know the right answer?
Java Program Assignment: Read in the size of an array from the user, then read in initial values int...
Questions
question
Mathematics, 24.10.2019 23:43
Questions on the website: 13722362