Get in touch with us
Send us an e-mail
Question
“Jump It” Game
The game “Jump It” consists of a board with n positive integers in a row, except for the first column, which always contains zero. These numbers represent the cost to enter each column. Here is a sample game board with n set to 6:
0 3 80 6 57 10
The objective of the game is to move from the first column to the last column with the lowest total cost. The number in each column represents the cost to enter that column. You always start the game in the first column and have two types of moves. You can either move to the adjacent column or jump over the adjacent column to land two columns over. The cost of a game is the sum of the costs of the visited columns.
In the board shown above, there are several ways to get to the end. Starting in the first column, our cost so far is 0. We could jump to 80, ten jump to 57, then move to 10 for a total cost of 80+57+10=147. However, a cheaper path would be to move to 3, jump to 6, then jump to 10, for a total cost of 3+6+10=19.
Write a recursive solution to this problem that computes the lowest cost of the game and outputs this value for an arbitrary large game board represented as an array. Your program does not have to output the actual sequence of jumps but only the lowest cost of this sequence. After making sure that your solution works on small arrays, test your solution on larger boards with larger values of n to get a feel for the scalability and efficiency of your solution.
Implement the game in a separate class Game. Write a driver that makes use of a Game object in a public class GameDriver that has the main method.
Summary
The question belongs to Computer Science and it discusses about developing a game called Jump It. The game is about moving from first column to the last column with the lowest total cost. This game needs to be developed using Java.
Total Word Count NA
Fiona O Farrell: I often lost track of the number of variables and how many equations I needed to evaluate in order to find the values. Then I came across HwA where the experts helped me out with two or three problems and helped me get a feel of how it needs to be done. That extra assistance with my simultaneous equation problems really helped me in the long run and I did well in my final exams.
I was pursuing my MSN degree when I thought of specializing in musculo-skeletal patients and it was back in 2008 when I came across HwA and learned a lot about the interventions and assessment strategies.
Always wanted to be in the lung and respiratory tract care unit of a hospital and these experts of HwA helped my dream come true. Through helping with respiratory system assignments and intervention advise the experts here in HwA, helped us a lot.
I was badly stuck with an argumentative term paper writing assignment when I started searching for help on the net. I never thought that I will get any sort of specialized help for the Australian universities and when HwA promised to deliver that, I thought why not? Then I chatted with the expert and she helped me out by writing and excellent term paper which helped me get great grades.
I was stuck with a strategic human resource management assignment when I first took help from HwA. The corporate strategy assignment expert was wonderful and since then I have taken assistance many more times.
Comments
this is a very good website
I have 50 questions for the same test your page is showing only 28
hi can you please help or guide me to answer my assignments. thanks
hi can anyone help or guide me to my assignments. thanks
This solution is perfect ...thanks
Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes
Perfect bank of solution.
great !
thanks for the quick response. the solution looks good. :)
thnx for the answer. it was perfect. just the way i wanted it.
works fine.