Reference no: EM132401487
Programming Assignment -
Goals -
Using arrays to save a(n) (un)known number of values.
Using more classes and recognising when to use extra classes.
Recognising the right class for the right method, variable or constant.
Pirate -
During his completely miserable life, pirate Abraham Blaufelt has been in search of the lost treasure of Atlantis. On a very fortunate day in the year of the Lord 1642 he enters an abandoned cathedral of a long gone sect in the ancient forests of Poland. Inside he finds a mysterious ancient parchment. The parchment reads:
Traveler, if you want to reach thine goal, trace the path through seas by making the broken, whole.
5, 4 4,5 8,7
Add behind 6,3 3,2 9,6 4,3
Add in front 7,6
Add behind 9,8
Add in front 5,5 7,8 6,5 6,4
Abraham Blaufelt immediately knew what he was dealing with. A puzzle of which the result is a safe route to the treasure. This route was essential, the sea was crawling with monsters in those days. Since this most fortunate day, almost four hundred years ago, the european tectonic plate has shifted significantly. As a result all coordinates have to be shifted by (1, 0).
Write a program that solves this puzzle. This has to be done in the following way: Start with the coordinates on the first row, add the coordinates of the second row at the back, then add the coordinates of the third row in front etc. Make a new Coordinate and CoordinateRow class for this assignment. The latter class has methods to add a CoordinateRow in front or at the back and methods to add a single Coordinate at the front or at the back.
The coordinates of the puzzle are in a file on Blackboard. Every CoordinateRow is separated from another by an '='. Every coordinate in a row is separated by a space. The x and y values of a coordinate are separated by a comma. After all data has been read, the program will print the treasure route on the standard output.
Attachment:- Assignment Files.rar