subject

In C++ programming languageJump GameGoalsPractice getting input from the command lineReview solving problems with recursionMatthew’s StatsTime taken: 40 minutesFiles: 3Lines of Code: 116 including whitespace and commentsRestrictions and RequirementsNo global variables may be usedYour submission must contain at least 2 or more .cpp files and one or more .h filesProblem DescriptionYou are given a list of integer numbers. Each number tells you how far to the right or left you can move from that spot. You can only move exactly that many spaces. Moving from one number to the next is considered a move. Your goal is to find the sequence of moves that get you from the first number to the last number in the fewest moves possible. If however, there is no sequence of moves that will get you to the end, then you should state that. For example, if you were given the listIndex0123456Value1241117Then the smallest sequence of moves that gets you from index 0 to index 6 is {0, 1, 3, 2, 6}.InputCommand Line ArgumentsWill always be validThe list of integers to solveEach integer will have a value greater than or equal to 0Standard will find recursion to be very helpful in solving this problem. When solving the problem, first go to the left and then go rightThis will help us to have the same solution if there are multiple equally valid solutionsIf a move would take you out of bounds of the list, for example, before the first entry or after the last entry, it is invalid and should not be takenExamplesExample 1./JumpGame 1 2 4 1 1 1 7 The solution is: {0, 1, 3, 2, 6}Example 2./JumpGameThere is no solution to the given game. What to SubmitA zip file containingThe .cpp and .h files that make up your solutionA CMakeLists. txt file that will generate an executable named JumpGame from your .cpp and .h filesMake sure to zip the files you want to submit and NOT the folder that contains the files. Submitting the folder with the files will cause your program to fail to build.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr.nextdouble(); minutestraveled = scnr.nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system.out.println("miles: " + milestraveled); } }
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
You know the right answer?
In C++ programming languageJump GameGoalsPractice getting input from the command lineReview solving...
Questions
question
Mathematics, 06.05.2020 03:17
question
Chemistry, 06.05.2020 03:17
Questions on the website: 13722360