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
Centralization, contingency, decentralization, efficiency, mechanistic, organic, organizational behavior, scientific management, stakeholder, or sustainability
Community Information Services-Level-Semester 2, Year 1-National Council for Higher Education- BACHELOR OF LIBRARY AND INFORMATION SCIENCE.
assume you were in a country where each person was either a truth teller or a liar. (A truth teller always tells the truth, a liar always lies.) What single question could you ask a person that would allow you to detect whether that person was a t..
Write a program in java that asks the name of the buyer and the number of shares bought.
write a 1400- to 1750-word paper describing how to formulate and present the business case for technology
Write a program that asks the user to enter the size for an array (greater than 0) and fills the array with a set of random numbers between 1 and the number.
You're telling a friendy'family member who is not familiar with a technology project about your milestones defined in the test plan. How would you explain
Write a Java program to calculate the squares and cubes of all integers from 1 to 10. Align the printout as in the sample output.
Develop a sales-tracking program that enables a company to keep track of its sales force's performance by quarter.
Write a program that asks the user to input a 3 X 3 matrix of integers, a row at a time.
What are the three main types of shift keying? What is meant by the sampling rate of analog data? What are the differences among EBCDIC, ASCII, and Unicode?
Make a product pitch for your selected product to present to potential stakeholders and Analysis of how your solution is similar to or different from existing
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