Question: Java Language A zombie apocalypse has occurred, and everyone you know is turning into a zombie. You are stuck in a shopping mall with your

Java Language
A zombie apocalypse has occurred, and everyone you know is turning into a zombie. You are stuck in a
shopping mall with your family, and unfortunately, there is a zombie in the shopping mall. To save yourself
and your loved ones, you decided to analyze the zombies' movement and try to destroy them, and noticed
the following:
At any time, the zombie can move one step down or one step to the right (each step resembles a cell in nx
m grid, where n is number of rows, and m is number of columns)
One step rights
One step down
Luckily, you have an amount of venom. To kill the zombies, you hide portions of venom inside P pieces of
meat distributed randomly across the cells of the grid, where 1dotsVV(0,0)(0,0)(n-1,m-1)20,38,31,41,51,52,62,63,73,74,845,9,9,961P,(at most one piece per step) and the
amount of venom in a piece is randomly chosen from the range 1dotsV, where Vis the maximum amount of
venom that can be hidden in a piece of meat. The zombie is currently at cell (0,0) which is the upper left
corner of the grid. If the zombie collected the maximum amount of venom hidden in the pieces of meat in
the path from the upper left corner to the lower right corner, the zombie will die. Write a program that finds:
The maximum amount of the pieces that a zombie could collect to reach any target step in the grid
starting from step (0,0),as shown in the table sample output.
The sequence of steps that the zombie should visit to collect the maximum amount of the pieces
starting from step (0,0)to step (n-1,m-1).
InputOutput sample
Enter the number of rows: 10
Enter the number of columns: 7
Enter the number of meat pieces: 40
Enter the maximum amount of venom for a piece: 30
Sample Random Distribution of the meat pieces with their corresponding venom amounts:
Output Table:
Path Traversedt te0,18,20,38,31,41,51,52,62,63,73,74,84
,5,9,9,961
 Java Language A zombie apocalypse has occurred, and everyone you know

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!