CSE 331 - Fall 2004 - Programming assignment # 1 DUE: Midnight, September 7, 2004 CAUTION: If submission is late, there is a 20% automatic penalty. NOTHING will be accepted if more than 2 days late. ----------------------------- Ford & Topp, Ch 1, Problem 46 ----------------------------- Create the geometry class in these two files to facilitate information hiding. geometry.h -- containing the class definition (The API) geometry.cpp -- containing ALL of the class function implementations Create your main program in this file prog1_1.cpp Create a file describing how you tested your class and main program. Give test cases representative of general and boundary condition inputs. Convince me that the program works. Submit this in the text file. testdoc1.txt Finally, make sure you submit a copy of your Microsoft Visual Studio project and solution files. Call them prog1_1.sln prog1_1.vcproj ------------------------------ Ford & Topp, Ch 15, Problem 34 ------------------------------ We have not discussed vectors or the book's matrix class, so you should create your own matrix class for representing the board. I suggest you create a class that has three member variables data -- a 2-dimensional array (8x8) of integers rows -- an int indicating # of rows in the board being used cols -- an int indicating # of columns in the board being used The constructor should set rows and cols and fill the data array with the value 0. The class should have get(r,c) and set(r,c,value) functions to use in place of the [][] operators in accessing the board. Example: // declare board matrix board(2,3); // declares a board of 2 x 3 integers // set a board value board.set(1,2,37); // causes board.data[1][2] to be set to 37 // get a board value board.get(2,2) // returns value of board.data[2][2] Note: You should implement range checking and prevent access of board elements that are out of bounds. The matrix class should be implemented in the files matrix.h matrix.cpp The display of the solution, if a knight's tour is found should be in the form of a grid of numbers (each formatted to occupy 2 character spaces and each surrounded by a rectangle of asterisks. Example: 4x4 board (note: this is not a complete solution but shows format of result output). Board position 0,0 is at upper left. ********************* * 1 * 14 * 5 * 10 * ********************* * 8 * 11 * 2 * 13 * ********************* * 15 * 4 * 9 * 6 * ********************* * * 7 * 12 * 3 * ********************* The main program should be implemented in the file prog1_2.cpp Again, create a testing method description to convince me it works. Submit it as testdoc2.txt Again, submit your MSVS project and solution files prog1_2.sln prog1_2.vcproj --------------------------------------------------------------------- Summary --------------------------------------------------------------------- Submit all of these files by MIDNIGHT, Tuesday, September 7, 2004 in your dropbox prog1 folder. /afs/nd/edu/coursefa.04/cse/cse331.01/dropbox//prog1 FILES: geometry.h geometry.cpp prog1_1.cpp testdoc1.txt prog1_1.soln prog1_1.vcproj matrix.h matrix.cpp prog1_2.cpp testdoc2.txt prog1_2.sln prog1_2.vcproj