Menu

[Solved]Description Lab Ben Loves Kitties Kitties Running Free Need Help Ben Identily O Matrix Con Q37279456

Description: Lab Ben loves Kitties and his kitties are running free. You need to help Ben identily o,matrix that contains a kimport java.util.Scanner: import static java.lang.System.* public class KittyMap private boolean 11) kittyGrid; //this constrimport java.io.File; import java.io.IOException; import java.util.Scanner; import static java.lang.System.*; public class KitDescription: Lab Ben loves Kitties and his kitties are running free. You need to help Ben identily o,matrix that contains a kitty will be set to true. Each cell that contains no kitty will be recover his lost kitties, you will create an integer matrix that stores the number of where his kitties are so he can get them all rounded up. Each cell in thet boolean set to false. Use Math.xandon to randomly place the Os and 1s in the grid-try mulitiplying by numbers larger than 2 if you want fewer kitties in the grid. As you work to help Ben kitties near each cell. Each cell that contains a kitty is set to 9. All other cells are set to the value of how kitties are around them. This integer grid will be used to determine the best location from which to start collecting Ben’s kitties. Sample Input It is all random. Sample Output many Files Needed:: Kittyapunper.5avi xittyMapRunner.java 0 000 000100000100ooo0 0000 000000000100 0010 0 0000000 000001010001 00001001 0100 0000o000 0000000001101000000。 0 0000001 0 0100 00000 0 0 BONUS Write a method to find the best place to drop a kitty collecting robot. The robot will fan out in all directions and collect all kitties within a 3 cell radlus. Your method should return the location of the best place to drop the robot 01000 0000 0000 0 0 000 01 0 0 000 0 0 00 00 0 01 0 0 0 o 0 o 0 0000 0 0 00 00100001o 0 0 0o0Dc00oo0000000 0001 00ธ0100000101000000 0000C1000100 ocOOoooD 0001 00 0 010c0 0 000o000 0001 0C01000 0 0 0 OOO0 0 0 1000000000000000ฉ000 0 000 ccCC0000 101 0 0100 0 DD000010010 0110 ooo0 0 DD000191000 2920 0 1 1 1 0000ฎ011100039411192 0 0D1911939 3 2 2 2 21 1 0 1 1 00011122499391000000 0 1 11 0029 3395 3200 00 0 1291 0 029 2 1 29 91 0 ODDE1 1921001110123210ฎ019 1 1 1 0 0000 00112911 1 11 1 0 0 0 С 0 0 0 0 0 1 9, 2 1 1 1 9111 0:0. ฏ 0 0 1 2 101110011:29 0 000 1 129 1 01 1 21 1 0 0 01 0 ฏ00 2 9 3 1 2 1 2 9 2 9 1 0000a 0 01 13 921: 292 1 2 11:0 000 o 002 9 3 1 2 2921-00000ฎ’Q0t import java.util.Scanner: import static java.lang.System.* public class KittyMap private boolean 11) kittyGrid; //this constructor loads in random true and false values public KittyMap(int rows, int cols) //this method will call getKittyCountsGrid //to retrieve the kitty counts for the kittyGrid public void printKittyCount () //this method will calculate the kitty counts for each cell //if cell is true set int value to 9 //if cell is not true set int value to cnt of kitties in adjacent cells private int getKittyCountsGrid) //this method will return the value of the current cell //if this cell contains a kitty -return 9 //otherwise return the ent of all kitties in adjacent ce1ls public int getKittyCount( int r, int c) //check r and c to ensure they are inside the grid private boolean inBounds( int r, int c) //return the kitty grid as a string public String tostring() String output=””; return output.trim) import java.io.File; import java.io.IOException; import java.util.Scanner; import static java.lang.System.*; public class KittyMapRunner throws IOException public static void main( String args KittyMap km new KittyMap(10, 10); System.out.println( km “Inin”) km.printKittyCount) Show transcribed image text Description: Lab Ben loves Kitties and his kitties are running free. You need to help Ben identily o,matrix that contains a kitty will be set to true. Each cell that contains no kitty will be recover his lost kitties, you will create an integer matrix that stores the number of where his kitties are so he can get them all rounded up. Each cell in thet boolean set to false. Use Math.xandon to randomly place the Os and 1s in the grid-try mulitiplying by numbers larger than 2 if you want fewer kitties in the grid. As you work to help Ben kitties near each cell. Each cell that contains a kitty is set to 9. All other cells are set to the value of how kitties are around them. This integer grid will be used to determine the best location from which to start collecting Ben’s kitties. Sample Input It is all random. Sample Output many Files Needed:: Kittyapunper.5avi xittyMapRunner.java 0 000 000100000100ooo0 0000 000000000100 0010 0 0000000 000001010001 00001001 0100 0000o000 0000000001101000000。 0 0000001 0 0100 00000 0 0 BONUS Write a method to find the best place to drop a kitty collecting robot. The robot will fan out in all directions and collect all kitties within a 3 cell radlus. Your method should return the location of the best place to drop the robot 01000 0000 0000 0 0 000 01 0 0 000 0 0 00 00 0 01 0 0 0 o 0 o 0 0000 0 0 00 00100001o 0 0 0o0Dc00oo0000000 0001 00ธ0100000101000000 0000C1000100 ocOOoooD 0001 00 0 010c0 0 000o000 0001 0C01000 0 0 0 OOO0 0 0 1000000000000000ฉ000 0 000 ccCC0000 101 0 0100 0 DD000010010 0110 ooo0 0 DD000191000 2920 0 1 1 1 0000ฎ011100039411192 0 0D1911939 3 2 2 2 21 1 0 1 1 00011122499391000000 0 1 11 0029 3395 3200 00 0 1291 0 029 2 1 29 91 0 ODDE1 1921001110123210ฎ019 1 1 1 0 0000 00112911 1 11 1 0 0 0 С 0 0 0 0 0 1 9, 2 1 1 1 9111 0:0. ฏ 0 0 1 2 101110011:29 0 000 1 129 1 01 1 21 1 0 0 01 0 ฏ00 2 9 3 1 2 1 2 9 2 9 1 0000a 0 01 13 921: 292 1 2 11:0 000 o 002 9 3 1 2 2921-00000ฎ’Q0t
import java.util.Scanner: import static java.lang.System.* public class KittyMap private boolean 11) kittyGrid; //this constructor loads in random true and false values public KittyMap(int rows, int cols) //this method will call getKittyCountsGrid //to retrieve the kitty counts for the kittyGrid public void printKittyCount () //this method will calculate the kitty counts for each cell //if cell is true set int value to 9 //if cell is not true set int value to cnt of kitties in adjacent cells private int getKittyCountsGrid) //this method will return the value of the current cell //if this cell contains a kitty -return 9 //otherwise return the ent of all kitties in adjacent ce1ls public int getKittyCount( int r, int c) //check r and c to ensure they are inside the grid private boolean inBounds( int r, int c) //return the kitty grid as a string public String tostring() String output=””; return output.trim)
import java.io.File; import java.io.IOException; import java.util.Scanner; import static java.lang.System.*; public class KittyMapRunner throws IOException public static void main( String args KittyMap km new KittyMap(10, 10); System.out.println( km “Inin”) km.printKittyCount)

Expert Answer


Answer to Description: Lab Ben loves Kitties and his kitties are running free. You need to help Ben identily o,matrix that contain… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *