Question: please write a working program using Java programming language Due: March 29th, 1 PM (Submission through Canvas) In this project, you will extend the dynamic




please write a "working" program using Java programming language
Due: March 29th, 1 PM (Submission through Canvas) In this project, you will extend the dynamic programming algorithm that we discussed in class for the Coin Collection problem in a two dimensional grid and implement the same. The conditions for the robot movement are as follows: at any time, the robot can move one cell down or one cell to the right One cell down One cell to the right Each of you are assigned a grid of dimensions n (rows) x m (eolumns) as specified in the next page. You are required to randomly distribute P number of coins (where Pk n'm) across the cells of the grid (at most one coin per cell). The value for a coin assigned to a cell is randomly chosen from the range !... V The P and V values are also assigned specifically for each student. Your tasks are as follows: (1) Implement the dynamic programming algorithm to cakculate the optimum (maximum) value of the coins that a robot could collect as it traverses from cell (0. D to any cell in the grid such that at any time, a robot can have one of the two movements mentioned above (2) Extend the dynamic programming algorithm to also keep track of the path traced by the robot to reach any target cell in the grid starting from cell (a 0. Clearly explain the logic of yocr algorithm to keep track of the path traced (3) As output, your code should print the followings (i) The optimum value of the coins that a robot could collect to reach any target cell in the gnd starting from cell (0, 0, as shown in the table sampke output tsce next page uib) The sequence of cells that the rola should visit to collect the optinum value of the coins starting from cell tO.:0) to cell tn-im:l (ii) The total number of horizontul movements to neat 01he right) und the individual horizontal movements as well as the total number of seeticat movements fone cell downrand the individual vertical movenients that the robot needs t i make to collect the p imum value of the cons starting from cell i 0,01 to cell in, I, m-1). arch
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
