Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING, please no copy paste from other solutions. In a Sudoku game, we have to re-build a grid with 9 rows and 9 columns.

JAVA PROGRAMMING, please no copy paste from other solutions.

image

In a Sudoku game, we have to re-build a grid with 9 rows and 9 columns. Each row and each column must contain all integers from 1 to 9. You must create a programm that allows you to load Sudoku grids from files, manipulate the grids (placements, checks), then finally reproduce the grids again either on screen or in files. Sudoku files contain a sequence of number triplets separated by spaces, where each triplet corresponds to: x: line number. y: column number. z: value In computing, columns and rows are most often numbered starting with zero. Examples: Content of file part1.txt 001 012 023 034 045 056 067 078 089 102 113 124 135 146 157 168 179 181 203 214 225 236 247 258 269 271 282 304 315 326 337 348 359 361 372 383 405 416 427 438 449 451 462 473 484 506 517 528 539 541 552 563 574 585 607 618 629 631 642 653 664 675 686 708 719 721 732 743 754 765 776 787 809 811 822 833 844 855 866 877 888 Contents of the file part2.txt 016 112 214 19 417 511 618 713 815 027 129 221 328 425 523 626 722 824 033 138 235 332 436 534 631 737 839 048 141 243 347 449 545 644 746 842 059 157 252 351 454 556 655 758 853 065 164 266 363 462 568 667 769 861 074 173 279 376 471 577 672 775 878 081 186 288 385 483 582 689 784 887 092 195 297 394 498 599 693 791 89 Contents of the part3.txt file 014 116 218 313 411 517 615 712 819 022 127 225 324 428 529 623 726 821 031 133 239 335 436 532 637 734 838 045 148 246 349 447 541 642 743 844 057 159 252 356 454 553 651 758 855 063 161 264 362 465 568 669 767 866 079 174 273 371 472 576 678 775 877 086 182 287 388 489 585 684 781 883 098 195 291 397 493 594 696 799 892 In these examples, the data is not necessarily correct. It's your job to create a program that can handle errors. You can create such a file on your machine with a text editor or you can use the preconfigured repl.it project where this file already appears. Required Features/Classes Your program must do three specific things: -Load a file containing data according to the specified format (a sequence of digit triplets separated by spaces). You can choose the approach you prefer. The file can be retrieved online, by opening a file on your disk, or by standard input ( stdin ). Your code should handle read errors. -Validate that the file corresponds to a valid Sudoku table. That is, it must correspond to a 9x9 table where each digit from 1 to 9 appears only once per column and only once per row. For the purposes of is work, we do not require that each 3x3 subgrid contain all the digits from 1 to 9 (you can, however, do this additional check if you wish). If there is an error, your program should throw an exception. -Your program should then apply a transposition to the array corresponding to a transposed matrix calculation and display the result on the screen. Instead of displaying it on the screen, you (as the programmer) can save it as a new file or use another means of transmission. Choose the approach that most appeals to you as a programmer. You should test your solution with more than one grid; in particular, include a grid that is asymmetrical (not identical to its transpose) in your tests. Give the result of at least two different tests, beyond the part1.txt file. You can use screenshots to present your results. You must explain your program carefully and in detail. Each function and each variable of the program must be justified. The qualifiers (static, public, protected and private) must be justified one by one: you cannot use the keyword "static" without justifying it.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To fulfill the requirements and create a program that loads validates transposes and displays Sudoku grids well structure our solution as follows Sudo... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Programming questions

Question

Help ASAP! requited, ube in mitur ligh to indicte a sont

Answered: 1 week ago