2080 11

Advanced Java Programming20805 marksNumerical: magic square programWorking with Files

Suppose that 9 integers are written in a file named 'magic.txt' in the arrangement of 3 x 3 separated by space. Write a program to check whether the integers in all rows, all columns, and both diagonals sum to the same constant or not.

Suppose that 9 integers are written in a file named 'magic.txt' in the arrangement of 3 x 3 separated by space. Write a program to check whether the integers in all rows, all columns, and both diagonals sum to the same constant or not. [5]

  • Input file: magic.txt - Contains 9 integers arranged as a $3 \times 3$ grid, separated by spaces. - Task: Verify whether all 3 rows, all 3 columns, and both diagonals sum to the same constant (magic square check). No specific numeric values are given for the integers in the question; the file c...
Up nextWrite a program to create a menu named 'File' with menu items 'New', 'Save,' and 'Exit'.