Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
1. Write a Java program to create a 9 X 9 sudoku problem. A sample of a 9 x 9 sudoku board is given below: The rules for the sudoku game are: i) Each row must contain the digits 1-9 without repetition ii) Each column must contain the digits 1-9 without repetition iii) Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition Procedure: 1. Import java.util.Random package and use the nextInt() method of the Random class to generate numbers between 1 and 9 for the sudoku board. 2. For each row, take a number from the user (between 4 and 6, both inclusive). Then, randomly generate that number of distinct digits between 0 and 8 (both inclusive) and assign 0s to those corresponding cells of that row in the array. For instance, if the user types 4 for the first row, then generate four distinct digits randomly using the nextInt() method of the Random class. If the four digits are 0, 3, 5, and 8, then assign 0 to [0][0], [0][3], [0][5], and [0][8] cells. Similarly, assign 0s to specific cells from the 2 nd to 9th rows. These 0s will represent empty cells. 3. Now, randomly generate distinct digits within the range 1 to 9 and assign them to empty cells of nine rows and nine columns as per the rules of the sudoku board. 4. Repetition within a 3 X 3 block is allowed for this assignment. 5. You don't have to check whether the sudoku is solvable or not. [Hint: 1. nextInt(n) method returns a digit between 0 and (n-1). To generate a digit from 0 to 8 for a cell index, call nextInt(9) method. To generate a digit from 1 to 9, use nextInt(9) + 1. 2. First, fill in the empty cells of nine cells of the first row and first column with distinct digits from 1 to 9. Then fill in the empty cells of the rest eight cells of the second row and second column as per the sudoku rule, and so on.] DO NOT use any array-related built-in Java classes and methods. You can use the Scanner class of Java to read the user input. Sample input: (User's inputs are shown in bold) Enter the empty cell number from 4 to 6 for each row Enter the number of empty cells of row 1: 6 Enter the number of empty cells of row 2: 5 Enter the number of empty cells of row 3: 6 Enter the number of empty cells of row 4: 6 Enter the number of empty cells of row 5: 5 Enter the number of empty cells of row 6: 4 Enter the number of empty cells of row 7: 6 Enter the number of empty cells of row 8: 5 Enter the number of empty cells of row 9: 6 Sample output:5 3 0 0 7 0 0 0 0 6 0 0 1 9 5 0 0 00 9 8 0 0 0 0 6 0
8 0 0 0 6 0 0 0 34 0 0 8 0 3 0 0 1 7 0 3 0 2 4 0 0 6 0 6 0 0 0 0 2 8 0 0 0 0 4 1 9 0 0 5 0 0 0 0 8 0 0 7 9
Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph
ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.
Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.
Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs
What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?
Paper describes about memory management. How memory is used in executing programs and its critical support for applications.
Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.
Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.
Analyze security requirements and develop a security policy
Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.
Define a suitable functional unit for a comparative study between two different types of paint.
Calculate yield to maturity (YTM) and bond prices
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd