Positive Integers Assignment | Homework For You

The game of “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 where n is 6:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
0 3 80 6 57 10

Homework For You

The object of the game is to move from the first column to the last column in 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, then jump to 57, then move to 10 for a total 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 cheapest cost of the game and outputs this value for an arbitrary large game board represented as a list. Because the program can take long time to run on large boards, you can assume that the board size is at most 50 columns. Your program doesn’t have to output the actual sequence of moves, only the cheapest cost of this sequence.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Your program must read input from a text file named input.txt and must send output to stdout (the computer’s screen). The input file consists of a sequence of lines, where each line corresponds to a board. The numbers on a line are the costs to enter the columns on the board. For example, the above board is represented in the input file as

0 3 80 6 57 10

Sample input file is as follows:

0 3 80 6 57 10
0 98 7 44 25 3 5 85 46 4
0 57 59 83 9 42 70
0 20 49 96 53 7 43 77
0 24 17 15 61 49 61 8 65 43 26 99 7 57 97 50 93 6 82 52

The corresponding output is as follows:


Please make sure to write your code in functions. No code should be written outside of functions. Use comments to document and explain your code where needed. Get Finance homework help today

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Writing Services
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Great work
Customer 463647, May 3rd, 2023
Computer science
I proofread the filled template. It was very helpful to understand what mistakes I had done in my first-week assignment. I learned about the topics.
Customer 462947, May 7th, 2022
Customer 463001, June 21st, 2022
Good job. Few edits made
Customer 463245, November 16th, 2022
Thank you for following and revising all the comments. Keep it up
Customer 463249, February 28th, 2023
Customer 462815, April 20th, 2022
yes I did
Customer 453969, February 11th, 2020
Leadership Studies
Writer was very patient and completed on time
Customer 452707, October 4th, 2022
you captured my imagination. good copy writing skills
Customer 452441, June 17th, 2022
Marketing & Advertising
Excellent work. Looking forward to your future contributions.
Customer 463467, December 1st, 2022
Good work.
Customer 456821, May 18th, 2022
Excellent job
Customer 456821, October 5th, 2022
Customer reviews in total
Current satisfaction rate
3 pages
Average paper length
Customers referred by a friend
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat