Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question

Write a Program Use a matrix represents an island surrounded by water. Two bridges lead out of the island. A mouse is positioned on the black square. Write down a program to make the mouse take a walk across the island. The mouse is allowed to travel one square at a time, either horizontally or vertically. A chance number from 1 through 4 have to be used to decide that direction the mouse is to take. The mouse drowns when he hits the water; he breaks out when he enters a bridge. You might generate a random number up to 100 times. If mouse does not find his way by the hundredth try, he will die of starvation. Restart the mouse in a reinitialized array and go back and repeat the whole process. Count up the number of times he escapes, drowns, and starves.

Input File-

1. First input line - size of array, as well as border of water and bridges

2.Next N input lines-the rows of the two-dimensional array, where the positions containing negative numbers represent the water, the positions in the edge containing a 0 represent the bridges, the position containing a 1 represents the starting position of the mouse, and all other positions contain 0s.

Output-

1. A line stating whether mouse escaped, drowned, or starved

2. A line show the mouse's starting position and the position of two bridges

3. A map show the frequency of the mouse's visits to each location

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9132963

Have any Question?


Related Questions in Computer Engineering

What does an income statement a balance sheet and a cash

What does an Income Statement, a Balance Sheet and a Cash Flow System intend to show about a company and how would you use the data contained within in making a credit determination?

System analysis and design1 describe a scenario in which

System Analysis and Design: 1) Describe a scenario in which the distribution of users determine the output technology. 2) What is the difference between gradual conversion and modular conversion? 3) At University, the co ...

University bookstores order books that instructors adopt

University bookstores order books that instructors adopt for the courses. The number of copies order matches the projected the demand. However, at the end of the semester the bookstore has too many copies on hand and mus ...

Seamus was assigned to created web site plan for a charity

Seamus was assigned to created Web site plan for a charity organization. He must ensure that the site includes the following features: -A message stating the purpose of the charity -An online form that will receive perso ...

In statistics the mode of a set of values is the value that

In statistics, the mode of a set of values is the value that occurs most often or with the greatest frequency. Write a function that accepts as arguments the following: A. An array of integers B. An integer that indicate ...

Suppose a consumer is trying to make a choice over the

Suppose a consumer is trying to make a choice over the consumption of two goods: x and y. Px = 3, Py = 4 and the income is equal to 50. Assume that the government distributes some stamps that are good to buy 5 units of g ...

Request this to be done in jgrasp1 add a method to the

Request this to be done in JGrasp 1. Add a method to the program that calculates the cube of every number between a lower bound and an upper bound that a user inputs (for instance, lower bound 1 and upper bound 9, for be ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

Question suppose that counting sort is used to sort n

Question : Suppose that counting sort is used to sort n numbers in the range [0, M]. What is the running time of the algorithm? Justify your answer. The response must be typed, single spaced, must be in times new roman f ...

A biostatistician is investigating the timenbspt to death

A biostatistician is investigating the time,  T , to death of a mouse exposed to a newly developed pesticide. He finds that the pdf of T is given by the following formula  f(t) = 15t 2 e -5t3 . Which of the following sta ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As