Using C#, solve the following problem by making use of a 2 dimensional array USE C# text in instructions file West East

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Using C#, solve the following problem by making use of a 2 dimensional array USE C# text in instructions file West East

Post by answerhappygod »

Using C#, solve the following problem by making use of a
2 dimensional array
Using C Solve The Following Problem By Making Use Of A 2 Dimensional Array Use C Text In Instructions File West East 1
Using C Solve The Following Problem By Making Use Of A 2 Dimensional Array Use C Text In Instructions File West East 1 (37.16 KiB) Viewed 28 times
Using C Solve The Following Problem By Making Use Of A 2 Dimensional Array Use C Text In Instructions File West East 2
Using C Solve The Following Problem By Making Use Of A 2 Dimensional Array Use C Text In Instructions File West East 2 (31.71 KiB) Viewed 28 times
USE C#
text in instructions file
West
East
South
South
South
South
South
East
East
West
East
East
West
West
South
South
West
East
South
South
West
North
North
North
North
North
Vusi has constructed a robot that operates on a two-dimensional grid of size 21 by 21 (a 7 by 7 grid is used here for illustration purposes only). From its initial position in the centre of the grid the robot can move based on the instructions North, East, South or West, so the robot's path is determined by a sequence of instructions stored in a text file (Instructions.txt). The robot cannot move off the grid so any instruction that would cause it to move outside the bounds of the grid is simply ignored (although that instruction counts as an additional visit the robot's current cell). (0,0) (6,0) North West East South
West East South (0,6) (6,6) Make use of a two dimensional array to determine all the cells on the grid that is visited by Vusi's robot after processing all the instructions in the Instructions.txt file. Keep track of how many times each cell is visited. Display a diagram which highlights the cells that were visited. For example, if the sequence of instructions in the file were East, East, East, East, East, South, South West, South West, South, then the diagram should look something like this: +++++++ +++++++ +++++ +++ *** +++++++ +++++** ++++*++
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply