magicsquare.java | |
File Size: | 2 kb |
File Type: | java |
This is a program that was created near the end of the year using arrays. It reads numbers diagonally, vertically and horizontally to check if the program is a magic square. Numbers that can be inputted into this program must range from 1-16. Arrays are used to output files from outside the program by calling on them; For exampple BufferedReader input = new BufferedReader (new FileReader ("prog415h.txt")); int num[] = new int [20]; This program will read the twenty numbers from the file prog415h.txt.