Cpp Assignment
CS 112 PA #4
Like the previous programming assignment, this assignment builds off of a prior lab. In this assignment you will write a program that solves a maze by finding a connection between two locations within the maze. As was the case with the prior assignment, you will probably need the StringSplitter used in class and lab.
Maze Text File
Our maze will be read in via text file. The first line informs us of the number of spaces in the maze. Each line afterwards describes a connection between two points in the maze. For example:
|
2 1 S 2 2 N 1 |
The example above tells us that we have two spaces in our maze. Furthermore, we see that space 1 has a southern connection to space 2. Similarly, space 2 has a northward connection to space 1. The possible connections are N (north), E (east), S (south), and W (west).
MazeSpace
Each space in the maze will be represented by an object of type MazeSpace. Here's the UML class diagram:
Additional Functions
In addition to the MazeSpace class above, you must implement the following two functions.
string depthFirstSearch(MazeSpace *spaces, int num_spaces, int start, int end)
string breadthFirstSearch(MazeSpace *spaces, int num_spaces, int start, int end)
These functions perform the depth / breadth first searches and returns a string that represents the path taken by each search pattern (see screenshot in the next section). Note that depending on how you implement your searches, you may not get the exact same output as what I provide. This is okay!
Sample Output
Below is sample output from my program:
Header Comment, and Formatting
1. Be sure to modify the file header comment at the top of your script to indicate your name, student ID, completion time, and the names of any individuals that you collaborated with on the assignment.
2. Remember to follow the basic coding style guide. For a list of basic rules, see my website or examine my example files from previous assignments and labs.
Reflection Essay
In addition to the programming tasks listed above, your submission must include an essay that reflects on your experiences with this homework. This essay must be at least 350 words long. Note that the focus of this paper should be on your reflection, not on structure (e.g. introductory paragraph, conclusion, etc.). The essay is graded on content (i.e. it shows deep though) rather than syntax (e.g. spelling) and structure. Below are some prompts that can be used to get you thinking. Feel free to use these or to make up your own.
· Describe a particular struggle that you overcame when working on this programming assignment.
· Conversely, describe an issue with your assignment that you were unable to resolve.
· Provide advice to a future student on how he or she might succeed on this assignment.
1. Describe the most fun aspect of the assignment.
1. Describe the most challenging aspect of the assignment.
1. Describe the most difficult aspect of the assignment to understand.
1. Provide any suggestions for improving the assignment in the future.
Deliverables
You must upload your assignment through Canvas no later than midnight on Friday, October 28, 2016. Remember that your submission must either contain a CodeBlocks or Visual Studio project file!
Grading Criteria
Your assignment will be judged by the following criteria:
Reflection essay (5pts)
· Your reflection meets the minimum requirements as specified earlier in this document.
Error Free Compile (5pts)
· [0] Your program contains compiler errors.
· [1] Your program compiles without issue.
Error Free Runtime (5pts)
· [0] Your program throws a runtime exception.
· [1] Your program does not encounter any runtime exceptions.
User Interface (5pts)
· [0] Your program does not even attempt to follow the UI guidelines
· [1] Your program's UI has major inconsistencies when compared to the sample output
· [2] Your program's UI has minor inconsistencies when compared to the sample output
· [3] Your program completely matches the specified user interface guidelines
Path Calculation (20pts)
· [0-5] You attempt to calculate a path, but it is vastly incorrect.
· [6-10] Your attempt to calculate a path, but it is slightly incorrect.
· [11-15] Your path calculations are mostly correct.
· [16-20] Your path calculations are correct.
Implementation (10pts)
· [0-2] Your program's implementation is inefficient. Class usage is non-existent, your code has a lot of redundancy, and is generally not up to the standards of what is expected of a CS 112 student.
· [3-7] Your program's implementation is acceptable, but can be improved upon. You may use classes, but they are used poorly. Likewise, some redundancy must exist.
Style (5pts)
· [0] Your code contains more than 7 distinct stylistic errors
· [1] Your code contains between 2 and 7 distinct stylistic errors
· [2] Your code contains 1 or 0 stylistic errors