Assignment 2 - COEN 243 ID: XXXXXXXXXX Assignment 2 - COEN 243 Stuart Thiel November 2, 2021 Introduction This assignment is worth 5% of your grade. This is an individual assignment (so individual, I...

c++ programming


Assignment 2 - COEN 243 ID: 40179457 Assignment 2 - COEN 243 Stuart Thiel November 2, 2021 Introduction This assignment is worth 5% of your grade. This is an individual assignment (so individual, I put your student ID on it) and you should not share your assignment with anyone else. The assignment is due November 11th at 5:00PM, Montreal time. All submissions must go through EAS: https://fis.encs.concordia.ca/eas/ After you submit, go back to check EAS to confirm that you just uploaded your assignment! Q1) Making a Robot You are writing a program that takes movement commands for a robot and then outputs the results. The robot itself will navigate a 10 x 10 grid, starting at position (7, 7) (where 0,0 is the bottom left position). The robot itself follows each movement instruction one at a time, and to execute that instruction it runs one of the following functions north(), south(), east() or west(), corresponding to the input directions 8, 2, 6 or 4 respectively. When the robot runs into a wall ignore the movement and move to the next input. If the robot enters a position for the 10th time, stop processing input: Bad robot! Record how many times the robot bumped into the walls. You don’t need to show the robot moving, but after the instructions are entered (on one line), the final result of the ”board” should be shown as follows. • Show a ’.’ for a position the robot has never been in • Show a number from 1 to 9, indicating how many times the robot has entered a position • Show a ’*’ for the starting position of the robot, unless that is also its final position • Show a ’R’ for the final position of the robot, unless it has entered a position 10 times • Show an X if the robot has entered a square 10 times Lastly, output how often the robot has collided with the walls. Your program should, at the very least, have a Robot class with the specified move methods. You may use C-style arrays, or the Array/Vector libraries, as you wish. The rest is up to you; use what you have learned. Page 1 https://fis.encs.concordia.ca/eas/ Assignment 2 - COEN 243 ID: 40179457 Example 4684886284264422226246462686868824844626666644628266844686446466488828246448462484288646884644848888 ..R155422. ....12554. .....11*1. .....11463 .....1.374 .....11.32 .....2311. ......11.. .......... .......... We ran into the edge 13 times. Page 2
Nov 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here