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.:- M9718215

Have any Question?


Related Questions in Computer Engineering

Describe an ethical conundrum found in a magazine or

Describe an ethical conundrum found in a magazine or newspaper article, and please give your own thoughts. Give good citations, of course.

Statistics and facts about smartphonessmartphones mobile

Statistics and facts about Smartphones Smartphones, mobile phones with more advanced computing capabilities and connectivity than regular mobile phones, came onto the consumer market in the late 90s, but only gained main ...

Subject is foundations of information technologyresearching

Subject is Foundations of Information Technology. Researching Web 2.0 Write a 5- to 7-page APA formatted research paper on any of the following topics. Research any associated tools, new developments, and benefits/disadv ...

A national report indicates that the mean and standard

A national report indicates that the mean and standard deviation of the ACT scores of incoming freshman at American public universities are 24.6 and 6.2, respectively. A sample of 30 incoming freshmen at a small, suburba ...

Suppose that the wall street journal reports that we are

Suppose that the Wall Street Journal reports that we are headed for a recession. You are the manager of a firm that produces Starcho Lunch. Your marketing research people tell you that the demand for your product is give ...

A club consists of 10 seniors 12 juniors and 15 sophomores

A club consists of 10 seniors, 12 juniors, and 15 sophomores. An organizing committee of size 5 is chosen randomly (with all subsets of size 5 likely). Find the probability that the committee has at least one representat ...

Systems analysis chapter 6 please answer the four questions

Systems analysis chapter 6: Please answer the four questions at the tasks section Campus Bikes is a popular bicycle shop located near a major university. The business has grown and the owner, Mark Turner, wants to instal ...

Discuss how the scope of computer security grew from

Discuss how the scope of computer security grew from physical security to include : Securing the data Limiting random and unauthorized access to that data. Involvement of personnel from multiple levels of the organizatio ...

Research the differences in file formats between ms office

Research the differences in file formats between MS Office 2003 and MS Office 2007. Explain how file signatures and metadata can be used to determine which versions of MS Office applications (e.g. Word, Excel, Power Poin ...

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

  • 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