Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: The language is beginners java but this assignment is lengthy. The purpose is to create a loop for this mouse which counts the number

Note: The language is beginners java but this assignment is lengthy. The purpose is to create a loop for this mouse which counts the number of steps it takes as well as the specific direction for each of the steps. They are generated randomly. Also, once the mouse passes a specific border, there are different situations for the mouse, which will involve if/if else or switch. If someone is willing to do this, I will be very appreciative.

Thank you

image text in transcribed

image text in transcribed

image text in transcribed

Objective: Objective of this HW is to use loops. In this HW assignment, you will be implementing a mouse game. There is a little mouse on an island which is connected to the main land with several bridges. After N(at most) random steps, the mouse will escape from the island, or will be stuck in the island, or will end up in the water surrounding the island. The following picture is depicting the island. The island is 14 by 14 unit square. The bridges (bold small lines) are indicated by points: [0,7].17,7],[7,01,17,- 7],[0-7],[-7,-7].[-7,0], and [-7,7]. There are a total of 8 bridges. 1-7 [0,7] 17,7 1-7,0] 17,0] 7,-7] [0,-71 A little mouse is sitting at position [0,0]. This place will be represented by two integer variables x and y. So intially x=0 and y-0 are indicating [0,0] as the starting position. The mouse will take one step a time. These steps can be To the right(R) / can be indicated by integer 0 To the left() // can be indicated by integer l To the up(U) can be indicated by integer 2 or To the down(D) can be indicated by integer 3 The mouse will take these steps randomly. For example, assume the mouse is allowed to take N-5 steps and these 5 steps are: Right, Right, Left, Up, and Right (RRLUR). So the mouse is intially at the starting point x=0 and y=0, after the first step, its position will be x=1 and y=0. After the second step which is to the right, the mouse will be at x=2, 0 After the 3rd, 4th, and 5th step the mouse will be at x-2,y indicated by [2,1]. Objective: Objective of this HW is to use loops. In this HW assignment, you will be implementing a mouse game. There is a little mouse on an island which is connected to the main land with several bridges. After N(at most) random steps, the mouse will escape from the island, or will be stuck in the island, or will end up in the water surrounding the island. The following picture is depicting the island. The island is 14 by 14 unit square. The bridges (bold small lines) are indicated by points: [0,7].17,7],[7,01,17,- 7],[0-7],[-7,-7].[-7,0], and [-7,7]. There are a total of 8 bridges. 1-7 [0,7] 17,7 1-7,0] 17,0] 7,-7] [0,-71 A little mouse is sitting at position [0,0]. This place will be represented by two integer variables x and y. So intially x=0 and y-0 are indicating [0,0] as the starting position. The mouse will take one step a time. These steps can be To the right(R) / can be indicated by integer 0 To the left() // can be indicated by integer l To the up(U) can be indicated by integer 2 or To the down(D) can be indicated by integer 3 The mouse will take these steps randomly. For example, assume the mouse is allowed to take N-5 steps and these 5 steps are: Right, Right, Left, Up, and Right (RRLUR). So the mouse is intially at the starting point x=0 and y=0, after the first step, its position will be x=1 and y=0. After the second step which is to the right, the mouse will be at x=2, 0 After the 3rd, 4th, and 5th step the mouse will be at x-2,y indicated by [2,1]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

1. How are language and thought related?

Answered: 1 week ago

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago