Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Advanced Programming Techniques Prof. Dr. Bernhard Humm, Hochschule Darmstadt – University of Applied Sciences Assignment: Software Categories For all assignments, please, note: 1. Decide which Java programming language constructs are suitable (classes vs. interfaces; new implementation vs. reusing existing implementation, etc.) 2. Implement your solution. Use English identifiers only 3. Document your solution with JavaDoc (in English) 4. Implement JUnit test cases 5. Test your solution 6. Commit your code to the SVN repository 1 Magic Square Check A magic square is a square array of distinct integers (each one different), where the numbers in each row, in each column, and in both diagonals all add up to the same number, called the “magic constant”. See https://en.wikipedia.org/wiki/Magic_square Examples: n = 3: 4 9 2 3 5 7 8 1 6 Seite 1 Advanced Programming Techniques n = 4: Albrecht Dürer: „Malinconia“ (1514) (detail) Task: 1. 2. 3. 4. 2 Implement a Java application which checks whether an array is a magic square. Read the n² array elements from a file. Write the result (as well as error message in case of false inputs) to a file Strictly separate A software (mathematical logic) from T software (file I/O). Design interfaces as simply as possible Optional: Generation of Magic Squares Implement an application which generates magic squares. Seite 2