Question

Write a C++/Java program to solve the problem below using Memoization: Problem Definition: Theres a theif...

Write a C++/Java program to solve the problem below using Memoization:

Problem Definition:
Theres a theif that enters a store during the night,and upon his entrance,the stores security systems detects the theif and the alarm goes off.The theif knows that theres a hidden door at the corner of this store and in order to escape,he has to get to it.Since the theif has limited time for his burglary,he can only Rob the stuff he comes by on his path towards the hidden door(the amount he can rob is unlimited).the problem is: which path should he choose to maximize his profits?there are also obstacles across the store,the theif cant go through them.

Write a C++/Java program to solve the problem belo

See the theif has to either go down or right towards the hidden exit,he cant go up or left.in the picture below,the positive integers are the value of the goods the theif can steal.the -1's indicate obstacles in the store,the theif cant step over these obstacles or go through them.

The first line of input is the size of the store,the store is represented by a square matrix therefore only one integer will be given in the first line
The next lines of input specify the landscape and map for the store

In the first line of the output must be the maximum value of goods the theif can steal on his way to the hidden exit
And the second line in the output specifies the path the burglar has to take to obtain this amount

To specify this path,you are to create a string of 0's and 1's
The 1's meaning moving downward one square and the 0's meaning moving rightward one square
For example,to show the path below,we use the string: 1111100000
Write a C++/Java program to solve the problem belo
In the case in which there are multiple paths for maximum profit,output the path for which the binary equivalent is greater
For example in the store represented below,there are two paths for the theif with equal goods stolen,both of which are maximum:

Write a C++/Java program to solve the problem belo

Output string for red path: 1100110010
Output string for the blue path: 1100001110
Since the binary value of the red path is greater, the second line of the output hast to print it as the best path
If the obstacles in the store are placed in a way the theif cant get to the exit door,the output BUSTED has to be printed to the console
1.
Sample input:
Write a C++/Java program to solve the problem belo
Sample output:
Write a C++/Java program to solve the problem belo
2.
Sample input:
Write a C++/Java program to solve the problem belo
Sample output:
Write a C++/Java program to solve the problem belo
3.
Sample input:

Write a C++/Java program to solve the problem belo
Sample output:
Write a C++/Java program to solve the problem belo
Write a C++/Java code that solves this problem using the Memoization design paradigm

WARNING: using any other method to solve the problem will not be accepted by my Professor

Thanks so much
0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Write a C++/Java program to solve the problem below using Memoization: Problem Definition: Theres a theif...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Using Dev C++, write a program to solve the problem as stated below. Write a program...

    Using Dev C++, write a program to solve the problem as stated below. Write a program will input a single integer value (all input will be exactly 8 digits long) and will store pairs of digits as individual integer values. The program will display the five 2-digit numbers as well as the average of these, each on their own line. Use a switch statement to print out Grade: and then either A (>=90), B ([80..89]), C ([70..79]), D ([60..69]) or...

  • Using Dev C++, write a program to solve the problem as stated below. Make use of...

    Using Dev C++, write a program to solve the problem as stated below. Make use of a repetition structure (counter-controlled while loop) to shorten part of your code Dont use array. Write a program will input a single integer value (all input will be exactly 8 digits long) and will store pairs of digits as individual integer values. The program will display the five 2-digit numbers as well as the average of these, each on their own line. Use a...

  • Please write a C++ Program for the following problem >> Vector: Calculation the sum of each...

    Please write a C++ Program for the following problem >> Vector: Calculation the sum of each two adjacent Numbers.... >>【Description】 Read integer numbers from keyboard and store them into a vector. Calculation the sum of each two adjacent Numbers, store the result into another vector. Then output the result inversely. For example, if the input is 1 2 3 4 5 then the output is 9 7 5 3 【 Input】 There are 5 test cases. For each case, there...

  • Write in C language . Thank you Count Sheep Jojo is having problem to sleep at...

    Write in C language . Thank you Count Sheep Jojo is having problem to sleep at night. He can't fall asleep and it makes him feel tired every day. Having this problem, Jojo told his friend Bibi, and Bibi advised him to do sheep counting while he tries to sleep. Jojo decided to try using this trick for N nights, to test its effectiveness. Jojo realized that he would fall asleep if he imagined a total of 10 white sheep....

  • *Java* You will write a program to do the following: 1. Read an input file with...

    *Java* You will write a program to do the following: 1. Read an input file with a single line of text. Create a method named load_data. 2. Determine the frequency distribution of every symbol in the line of text. Create a method named 3. Construct the Huffman tree. 4. Create a mapping between every symbol and its corresponding Huffman code. 5. Encode the line of text using the corresponding code for every symbol. 6. Display the results on the screen....

  • Write, test and document a Python program, in a file called MarsCoins.py, to solve the following problem Marvin from Ma...

    Write, test and document a Python program, in a file called MarsCoins.py, to solve the following problem Marvin from Mars has a jar full of martian currency (Maruvians, Caruvians, Taruvians and Paruvians). The breakdown of the currency units on Mars is as follows: The single smallest unit of currency is a Paruvian 6 Paruvians 1 Taruvian 12 Paruvians 1 Caruvian 24 Paruvians1 Maruvian Marvin wants to share his money with his friends but he doesn.t want to carry around all...

  • Need help!! Java Eclipse Please provide the screenshot of output of code as well. thank you......

    Need help!! Java Eclipse Please provide the screenshot of output of code as well. thank you... PROGRAM 1 –Linear Data Structure Implementation (Due date: March 5th, 2019, 5% Grade Points) Given the starting point in a maze, you are to find and mark a path out of the maze which is represented by a 30x30 array of 1s (representing hedges) and 0s (representing the foot-paths). There is only one exit from the maze (represented by E). You may move vertically...

  • Need help with java In this program you will use a Stack to implement backtracking to solve Sudok...

    need help with java In this program you will use a Stack to implement backtracking to solve Sudoku puzzles. Part I. Implement the stack class.  Created a generic, singly-linked implementation of a Stack with a topPtr as the only instance variable. Implement the following methods only: public MyStack() //the constructor should simply set the topPtr to null public void push(E e) public E pop()  Test your class thoroughly before using it within the soduku program Part II. Create...

  • Exercise #4: Some Operations on Strings Write a program that uses a C-string to store a...

    Exercise #4: Some Operations on Strings Write a program that uses a C-string to store a string entered from the keyboard (in lower case letters). The program will then provide 6 options about operations performed on the input string in the form of a menu, as shown in the following sample Input/Output. The 6 operations are given below: 1. print the string 2 reverse the string 3. print the length of the string 4. convert the lower letters to upper...

  • this is a C++ program! You will write a program that performs the following tasks for...

    this is a C++ program! You will write a program that performs the following tasks for a simple mathematical calculator: (1) Open a user-specified file for input. Prompt for the name of the file, read it into a string variable, echo print it to the terminal and then open it. If the file is not opened, enter into a loop that prints out an error message, resets the input file stream variable (see the hints section), obtains a new file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT