Question: This is c++ program. Please do not reuse any program on Chegg. Thank you!! COSC 2436 521 Program Set #1 Total Points: 30 Three problems
This is c++ program. Please do not reuse any program on Chegg. Thank you!!









COSC 2436 521 Program Set #1 Total Points: 30 Three problems must be implemented for full credit. Each section will state how many problems to implement within it. The required (starred) problem marked in the set must be implemented by everyone. See 2436 Grading Guide Sheet for additional grading/submission information. Partial credit will be given. (10 points each) Section One- COSC 1436/COSC 1437 Review. Choose two problems. 1. Write a program that determines a winner of a 2-player poker match. A poker hand of five playing cards drawn from a standard 52-card deck has a value, based on the table below. Each card has a rank (2-9, 10, Jack, Queen, King, or Ace) and a suit (*, ,, or ). The first character in each string will be the rank of the card and will be one of A23456789TJQK. The second character in the string will be the suit of the card and will be one of CDHS. Thus, "AS" represents the Ace of Spades, while "TC" represents the Ten of Clubs. 9 8 7 Power Poker Hand Description Examples Value 10 ROYAL FLUSH The 10, Jack, Queen, King and Ace of the same AK Q.JT suit. This hand is the strongest of all poker hands. STRAIGHT FLUSH Five cards in sequence. Aces can play low or high Q4 JA T4 94 84 (default). All cards belong to the same suit. Note or that Ace may not "wrap around" and play both 5.4. 3. 2 A high and low. FOUR OF A KIND Contains all four cards of one rank and any other 94 94 96 9V ) (unmatched) card FULL HOUSE Contains three matching cards of one rank and 74 70 71 44 44 two matching cards of another rank FLUSH All five cards are of the same suit, but not in Q. 97.43 sequence STRAIGHT Five cards in sequence using at least two different A4 K4 Q.JAT suits. Aces can play low or high. Note that Ace or may not "wrap around" and play both high and 54 4.3. 24 A low. THREE OF A KIND Contains three matching cards of the same rank Q4QWQ* 74 44 and two unmatched cards of other ranks TWO PAIR Contains two cards of the same rank, plus two TATA 8 84 A cards ofanother rank (that match each other but not the first pair), plus any card not of either rank 6 5 4 3 COSC 2436 S21 2 ONE PAIR 40 44 KAT 54 Contains two cards of one rank, plus three cards which are neither of that rank nor the same as each other. Five cards not meeting any of the above requirements. 1 HIGH CARD KV JV 84 744 Play with two players and use a string to enter names via the keyboard. Hands will be input from the keyboard with five card representations, separated by a single space between each card (convert to uppercase). If the user enters an illegal card or tries to enter the same card twice, the program will ignore the card, issue an error, and then request another card. Check for high card winners and check for ties. Hands are ranked first by category, then by individual card ranks. That is, even the minimum qualifying hand in a certain category defeats all hands in all lower categories. The smallest two pair hand, for example, defeats all hands with just one pair or no pair. Only between two hands in the same category are card ranks used to break ties. The highest single card in each flush or straight is used to break ties (the ace-through-five straight is the lowest straight, the ace being a low card in this context). Within two pair hands, the higher pairs are first compared. If they tie, then secondary pairs are compared, and then finally the kicker. if equal strength royal flush straight flush four of a kind full house flush straight three of a kind winner determined by tie breaker always a tie highest value card highest value four of a kind highest value three of a kind highest value card; else next highest value card; else next highest, etc. highest value card highest value three of a kind; else highest value lone card; else next highest value lone card highest value pair; otherwise, next highest value pair; else highest value lone card highest value pair; else highest value lone card. else next highest value lone card; else next highest value lone card highest value card; else next highest value card; else next highest, etc. two pairs one pair high card Output will consist of a line of text by itself, consisting of the player's name, strongest poker hand cards (in CAPITAL LETTERS) and the fully described hand similar to below: AD KD TD QD ID: ROYAL FLUSH, Diamonds 5D 3D 2D AD 4D: STRAIGHT FLUSH, Diamonds, 5 high 9C 9S JH 9D 9H: FOUR OF A KIND, 9's 75 4C 7C 7D 45: FULL HOUSE, 7's full of 4's (NOTE: full of ) QD 9D 7D 4D 3D: FLUSH, Diamonds, Q high AC JS KC QD TS: STRAIGHT, A high QS 4C QH 75 QD: THREE OF A KIND, Q's TS 8H TC 8C AD: TWO PAIR, L's and 8's (NOTE: Higher ranking pair is listed first) 43 TD 45 KS 55: ONE PAIR, 4's KC 3D 2H AS JH: HIGH CARD, K High Finally, output to the screen the winner and ask the user if he/she would like to play again (upper and lowercase). Error check as needed. A standard deck of cards is used- no jokers. No betting required. The program must use user-defined functions/methods, only use one dimensional arrays, no vectors or ArrayLists to represent data, and does not use any sorts. Also, do not use break or continue statements with loops or bitwise operations. For C++ use the string class. Refer to the sample output below. Sample Run: Enter player 1 name: James Enter player 2 name: Morgan James: Enter a card: TC Enter a card: 2D Enter a card: 2D Duplicate Card. Try again. Enter a card: 5H Enter a card: 5C Enter a card: 5D Morgan: Enter a card: KS Enter a card: JS Enter a card: 59 Bad Card. Try again Enter a card: 95 Enter a card: 25 Enter a card: 35 James: TC 2D 5H 5C 5D: THREE OF A KIND, 5's Morgan: KS JS 95 25 35: FLUSH, Spades, K high Morgan wins!! Play again (Y/N)? Y James: Enter a card: AD Enter a card: JH Enter a card: 95 Enter a card: 5D Enter a card: 3C Morgan: 3 Enter a card: AS Enter a card: TD Enter a card: yC Bad Card. Try again Enter a card: 9C Enter a card: 6H Enter a card: 4H James: AD JH 9S 5D 3C: HIGH CARD, I High Morgan: AS TD 9C 6H 4H: HIGH CARD, T High James wins!! Play again (Y/N)? y James: Enter a card: AD Enter a card: JH Enter a card: 95 Enter a card: 6D Enter a card: 4C Morgan: Enter a card: AS Enter a card: JD Enter a card: 90 Enter a card: 6H Enter a card: 4H James: AD JH 9S 6D 4C: HIGH CARD, A High Morgan: AS JD 9C 6H 4H: HIGH CARD, A High Tie-split pot!! Play again (Y/N)? n Name the program: PokerGameXX.java or PokerGameXX.cpp, where XX are your initials. 2. Write a program that prompts the user to enter the size of the rows and columns (between 2 and 5) for a matrix (2D array). The program will randomly fill the numbers and 1 into the matrix, print the matrix, and output the minimum number of rectangles/squares that can cover all the 1 values in the matrix to the screen. The size of a rectangle/square is defined by the number of 1's in it. There may be two or more largest rectangles/squares of the same size, and values may "wrap around" or overlap to determine the size. Here are the rules in forming groups of ones: Consider the consecutive 'ones' in the matrix and group them (green boxes). 0011 1100 4 Each group should contain the largest number of 'ones' and no blank cells. 0 110 0110 Incorrect Correct The number of 'ones' in a group must be a power of 2 i.e. a group can contain: 16(= 24) or 8(=22) or 4(= 22) or 2 = 24) or 1(=2") cells 0111 0111 Incorrect Correct Grouping is carried-on in decreasing order meaning, one has to try to group for 8 (octet) first, then for 4 (quad), followed by 2 and lastly for 1 (isolated ones'). 1 (1 11 T 1 1 1 1 Incorrect Correct Grouping is done either horizontally or vertically or in terms of rectangles/squares. Diagonal grouping of 'ones' is not permitted. 000 0 h 0 o 110 0 0 0 1 0 Correct Incorrect The same element(s) may repeat in multiple groups only if this increases the size of the group. 1 0 1 1 0 0 1 1 0 Incorrect Correct The elements around the edges of the matrix, including the four corners, are considered to be adjacent and can be grouped together. 11 0 0 1 1 00 1 Finally, the program should ask if the user wants to run the program again (Check case). Error check input size. Refer to the sample output below. 5 Sample Run: Enter the number of rows (2-5): 2 Enter the number of cols (2-5): 4 Generated grid: 1001 1000 The minimum number of rectangles/squares formed is 2 Run Again (Y/N): Y Enter the number of rows (2-5): 2 Enter the number of cols (2-5): 4 Generated grid: 1001 1 0 0 1 The minimum number of rectangles/squares formed is 1 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 1010 0 1 0 0 OOOO 2001 The minimum number of rectangles/squares formed is 4 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 1 1 0 1 OOOO OOOO 1001 The minimum number of rectangles/ squares formed is 2 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 0 0 0 1 O 01 0 0 11 1 1 1 1 The minimum number of rectangles/ squares formed is 3 Run Again (Y/N): y Enter the number of rows (2-5): 3 Enter the number of cols (2-5): 5 Generated grid: 0 0 1 0 1111 1111 The minimum number of rectangles/squares formed is 2 Run Again (Y/N): N Name the program: MinRectanglesXX.java or MinRectanglesXX.cpp, where XX are your initials. 3. A carpet company has an extra unique flair because they pride themselves on conscientious covering of any room using only carpet cut in the shape of squares. Write a program to help the company cover a room with the fewest pieces of carpet needed. The carpet squares all measure an integer number of feet on each edge, and only accepts jobs for rooms with both width (W) and length (L) in integer number of feet. Obviously if a room is perfectly square, the company can finish the job with a single piece of carpet, and the maximum number of carpet squares that would ever be needed is L x W squares, each 1-foot on a side. Input from the keyboard the width and length of the room as integers up to a maximum size of 25. Output to the screen on the first line, "N squares can cover W x L " (replacing N, W, and L with their respective values). On the next line print the sizes of the squares in increasing order, separated by spaces. Finally, output a blank line and then print a map of the room, using a different capital letter (A, B, ...) for each square of carpet used. The map may not match the sample output, but the minimum number of squares must. Error check inputs. For C++ use the string class. Refer to the sample output below. Sample Run: Enter the carpet width and length: 11 10 6 squares can cover 11x10. 224 5 5 6 AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB 7 AAAAAACCCCC DDDDE ECCCCC DDDDE ECCCCC DDDDFFCCCCC DDDDFFCCCCC Name the program: Carpet Coverxx.java or CarpetCoverXX.cpp, where XX are your initials. Required Problem - Comprehensive. 4(**). Write a program to create and solve Sudoku puzzles. The program should allow the user to: Enter a Sudoku interactively from the keyboard Load a Sudoku from a text file. Randomly generate and solve a Sudoku For each of the cases above check for multiple or no solutions and invalid inputs. Print the generated and solved solutions (only 2 if applicable) to the screen in the same format as shown below. Finally, the program should ask if the user wants to run the program again (Check case). Let the user input the file name from the keyboard. Use functions/methods as appropriate. Do not use recursion. The professor will provide code for you modify. Refer to the sample output below. Sample Run: Do you wish to? 1. Enter a Sudoku from the keyboard. 2. Load a Sudoku from a data file. 3. Randomly generate and solve a Sudoku. >> 3 Generated Sudoku: +---- | 53 1 - 7-1 | 6 | 1951 | -98 | | 6 8 - | 4 | 7 - ! - 6 - | 8 31 2 - 1 3 1 | 6 6 | 1 | | 4191 8 1 | 51 791 Sample solution 1: Solution 1: | 532 | 6 7 8 9 14 | | 6 7 4 | 195328|| | 19 8 3 4 2 5 6 7|| 8 ------+ -----+ | 819 7 6 4 | 253 | 426 | 853 | 7 911 | 753 | 921 | 48 6 i | 961 | 537 | 8 42 | | 287 | 419 635 | 345 | 286 | 1791 Solution 2: +------ | 5 3 2 6 7 8 9 14 | 674 | 195 | 328 | 198 34 2 567 | + | 819 764 | 253 | 426 | 853 | 791| 753 9 2 1 8 4 6 | + 961 | 537 | 482 | | 287 4 19 635 | | 3 4 5 1 2 8 6 | 17 9 | There are 18 solutions Run Again (Y/N)? y Do you wish to? 1. Enter a sudoku from the keyboard. 2. Load a sudoku from a data file. 3. Randomly generate and solve a Sudoku. >> 1 Enter a Sudoku puzzle: 0 601 0 40 50 008 3 0 5 600 200000001 800 407006 00 600 300 7009 010 04 50000002 0720690 040 50 80 70 Solution 1: +------ | 963 | 1 7 4 2 5 8 | 1 78 3 2 5 | 6 49 2 5 4 6 8 9 7311 -- + | 8 2 1 | 437 | 596 | | 496 | 8 5 2 317| | 735 | 961 | 824 | 9 COSC 2- +----- | 589 713 | 462 | | 317 | 2 46 1985 | | 4 2 | 598 | 173 | Run Again (Y/N)? Y Do you wish to? 1. Enter a sudoku from the keyboard. 2. Load a sudoku from a data file. 3. Randomly generate and solve a Sudoku. > 2 Enter the file name: sudoku.txt eeeeeee eeeeeeee1 eee9e1eee eeeeeeeee 4 10 Invalid Input Run Again (Y/N)? n Name the program: Sudokusolverxx.java or Sudokusolverxx.cpp, where XX are your initials. COSC 2436 521 Program Set #1 Total Points: 30 Three problems must be implemented for full credit. Each section will state how many problems to implement within it. The required (starred) problem marked in the set must be implemented by everyone. See 2436 Grading Guide Sheet for additional grading/submission information. Partial credit will be given. (10 points each) Section One- COSC 1436/COSC 1437 Review. Choose two problems. 1. Write a program that determines a winner of a 2-player poker match. A poker hand of five playing cards drawn from a standard 52-card deck has a value, based on the table below. Each card has a rank (2-9, 10, Jack, Queen, King, or Ace) and a suit (*, ,, or ). The first character in each string will be the rank of the card and will be one of A23456789TJQK. The second character in the string will be the suit of the card and will be one of CDHS. Thus, "AS" represents the Ace of Spades, while "TC" represents the Ten of Clubs. 9 8 7 Power Poker Hand Description Examples Value 10 ROYAL FLUSH The 10, Jack, Queen, King and Ace of the same AK Q.JT suit. This hand is the strongest of all poker hands. STRAIGHT FLUSH Five cards in sequence. Aces can play low or high Q4 JA T4 94 84 (default). All cards belong to the same suit. Note or that Ace may not "wrap around" and play both 5.4. 3. 2 A high and low. FOUR OF A KIND Contains all four cards of one rank and any other 94 94 96 9V ) (unmatched) card FULL HOUSE Contains three matching cards of one rank and 74 70 71 44 44 two matching cards of another rank FLUSH All five cards are of the same suit, but not in Q. 97.43 sequence STRAIGHT Five cards in sequence using at least two different A4 K4 Q.JAT suits. Aces can play low or high. Note that Ace or may not "wrap around" and play both high and 54 4.3. 24 A low. THREE OF A KIND Contains three matching cards of the same rank Q4QWQ* 74 44 and two unmatched cards of other ranks TWO PAIR Contains two cards of the same rank, plus two TATA 8 84 A cards ofanother rank (that match each other but not the first pair), plus any card not of either rank 6 5 4 3 COSC 2436 S21 2 ONE PAIR 40 44 KAT 54 Contains two cards of one rank, plus three cards which are neither of that rank nor the same as each other. Five cards not meeting any of the above requirements. 1 HIGH CARD KV JV 84 744 Play with two players and use a string to enter names via the keyboard. Hands will be input from the keyboard with five card representations, separated by a single space between each card (convert to uppercase). If the user enters an illegal card or tries to enter the same card twice, the program will ignore the card, issue an error, and then request another card. Check for high card winners and check for ties. Hands are ranked first by category, then by individual card ranks. That is, even the minimum qualifying hand in a certain category defeats all hands in all lower categories. The smallest two pair hand, for example, defeats all hands with just one pair or no pair. Only between two hands in the same category are card ranks used to break ties. The highest single card in each flush or straight is used to break ties (the ace-through-five straight is the lowest straight, the ace being a low card in this context). Within two pair hands, the higher pairs are first compared. If they tie, then secondary pairs are compared, and then finally the kicker. if equal strength royal flush straight flush four of a kind full house flush straight three of a kind winner determined by tie breaker always a tie highest value card highest value four of a kind highest value three of a kind highest value card; else next highest value card; else next highest, etc. highest value card highest value three of a kind; else highest value lone card; else next highest value lone card highest value pair; otherwise, next highest value pair; else highest value lone card highest value pair; else highest value lone card. else next highest value lone card; else next highest value lone card highest value card; else next highest value card; else next highest, etc. two pairs one pair high card Output will consist of a line of text by itself, consisting of the player's name, strongest poker hand cards (in CAPITAL LETTERS) and the fully described hand similar to below: AD KD TD QD ID: ROYAL FLUSH, Diamonds 5D 3D 2D AD 4D: STRAIGHT FLUSH, Diamonds, 5 high 9C 9S JH 9D 9H: FOUR OF A KIND, 9's 75 4C 7C 7D 45: FULL HOUSE, 7's full of 4's (NOTE: full of ) QD 9D 7D 4D 3D: FLUSH, Diamonds, Q high AC JS KC QD TS: STRAIGHT, A high QS 4C QH 75 QD: THREE OF A KIND, Q's TS 8H TC 8C AD: TWO PAIR, L's and 8's (NOTE: Higher ranking pair is listed first) 43 TD 45 KS 55: ONE PAIR, 4's KC 3D 2H AS JH: HIGH CARD, K High Finally, output to the screen the winner and ask the user if he/she would like to play again (upper and lowercase). Error check as needed. A standard deck of cards is used- no jokers. No betting required. The program must use user-defined functions/methods, only use one dimensional arrays, no vectors or ArrayLists to represent data, and does not use any sorts. Also, do not use break or continue statements with loops or bitwise operations. For C++ use the string class. Refer to the sample output below. Sample Run: Enter player 1 name: James Enter player 2 name: Morgan James: Enter a card: TC Enter a card: 2D Enter a card: 2D Duplicate Card. Try again. Enter a card: 5H Enter a card: 5C Enter a card: 5D Morgan: Enter a card: KS Enter a card: JS Enter a card: 59 Bad Card. Try again Enter a card: 95 Enter a card: 25 Enter a card: 35 James: TC 2D 5H 5C 5D: THREE OF A KIND, 5's Morgan: KS JS 95 25 35: FLUSH, Spades, K high Morgan wins!! Play again (Y/N)? Y James: Enter a card: AD Enter a card: JH Enter a card: 95 Enter a card: 5D Enter a card: 3C Morgan: 3 Enter a card: AS Enter a card: TD Enter a card: yC Bad Card. Try again Enter a card: 9C Enter a card: 6H Enter a card: 4H James: AD JH 9S 5D 3C: HIGH CARD, I High Morgan: AS TD 9C 6H 4H: HIGH CARD, T High James wins!! Play again (Y/N)? y James: Enter a card: AD Enter a card: JH Enter a card: 95 Enter a card: 6D Enter a card: 4C Morgan: Enter a card: AS Enter a card: JD Enter a card: 90 Enter a card: 6H Enter a card: 4H James: AD JH 9S 6D 4C: HIGH CARD, A High Morgan: AS JD 9C 6H 4H: HIGH CARD, A High Tie-split pot!! Play again (Y/N)? n Name the program: PokerGameXX.java or PokerGameXX.cpp, where XX are your initials. 2. Write a program that prompts the user to enter the size of the rows and columns (between 2 and 5) for a matrix (2D array). The program will randomly fill the numbers and 1 into the matrix, print the matrix, and output the minimum number of rectangles/squares that can cover all the 1 values in the matrix to the screen. The size of a rectangle/square is defined by the number of 1's in it. There may be two or more largest rectangles/squares of the same size, and values may "wrap around" or overlap to determine the size. Here are the rules in forming groups of ones: Consider the consecutive 'ones' in the matrix and group them (green boxes). 0011 1100 4 Each group should contain the largest number of 'ones' and no blank cells. 0 110 0110 Incorrect Correct The number of 'ones' in a group must be a power of 2 i.e. a group can contain: 16(= 24) or 8(=22) or 4(= 22) or 2 = 24) or 1(=2") cells 0111 0111 Incorrect Correct Grouping is carried-on in decreasing order meaning, one has to try to group for 8 (octet) first, then for 4 (quad), followed by 2 and lastly for 1 (isolated ones'). 1 (1 11 T 1 1 1 1 Incorrect Correct Grouping is done either horizontally or vertically or in terms of rectangles/squares. Diagonal grouping of 'ones' is not permitted. 000 0 h 0 o 110 0 0 0 1 0 Correct Incorrect The same element(s) may repeat in multiple groups only if this increases the size of the group. 1 0 1 1 0 0 1 1 0 Incorrect Correct The elements around the edges of the matrix, including the four corners, are considered to be adjacent and can be grouped together. 11 0 0 1 1 00 1 Finally, the program should ask if the user wants to run the program again (Check case). Error check input size. Refer to the sample output below. 5 Sample Run: Enter the number of rows (2-5): 2 Enter the number of cols (2-5): 4 Generated grid: 1001 1000 The minimum number of rectangles/squares formed is 2 Run Again (Y/N): Y Enter the number of rows (2-5): 2 Enter the number of cols (2-5): 4 Generated grid: 1001 1 0 0 1 The minimum number of rectangles/squares formed is 1 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 1010 0 1 0 0 OOOO 2001 The minimum number of rectangles/squares formed is 4 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 1 1 0 1 OOOO OOOO 1001 The minimum number of rectangles/ squares formed is 2 Run Again (Y/N): Y Enter the number of rows (2-5): 4 Enter the number of cols (2-5): 4 Generated grid: 0 0 0 1 O 01 0 0 11 1 1 1 1 The minimum number of rectangles/ squares formed is 3 Run Again (Y/N): y Enter the number of rows (2-5): 3 Enter the number of cols (2-5): 5 Generated grid: 0 0 1 0 1111 1111 The minimum number of rectangles/squares formed is 2 Run Again (Y/N): N Name the program: MinRectanglesXX.java or MinRectanglesXX.cpp, where XX are your initials. 3. A carpet company has an extra unique flair because they pride themselves on conscientious covering of any room using only carpet cut in the shape of squares. Write a program to help the company cover a room with the fewest pieces of carpet needed. The carpet squares all measure an integer number of feet on each edge, and only accepts jobs for rooms with both width (W) and length (L) in integer number of feet. Obviously if a room is perfectly square, the company can finish the job with a single piece of carpet, and the maximum number of carpet squares that would ever be needed is L x W squares, each 1-foot on a side. Input from the keyboard the width and length of the room as integers up to a maximum size of 25. Output to the screen on the first line, "N squares can cover W x L " (replacing N, W, and L with their respective values). On the next line print the sizes of the squares in increasing order, separated by spaces. Finally, output a blank line and then print a map of the room, using a different capital letter (A, B, ...) for each square of carpet used. The map may not match the sample output, but the minimum number of squares must. Error check inputs. For C++ use the string class. Refer to the sample output below. Sample Run: Enter the carpet width and length: 11 10 6 squares can cover 11x10. 224 5 5 6 AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB AAAAAABBBBB 7 AAAAAACCCCC DDDDE ECCCCC DDDDE ECCCCC DDDDFFCCCCC DDDDFFCCCCC Name the program: Carpet Coverxx.java or CarpetCoverXX.cpp, where XX are your initials. Required Problem - Comprehensive. 4(**). Write a program to create and solve Sudoku puzzles. The program should allow the user to: Enter a Sudoku interactively from the keyboard Load a Sudoku from a text file. Randomly generate and solve a Sudoku For each of the cases above check for multiple or no solutions and invalid inputs. Print the generated and solved solutions (only 2 if applicable) to the screen in the same format as shown below. Finally, the program should ask if the user wants to run the program again (Check case). Let the user input the file name from the keyboard. Use functions/methods as appropriate. Do not use recursion. The professor will provide code for you modify. Refer to the sample output below. Sample Run: Do you wish to? 1. Enter a Sudoku from the keyboard. 2. Load a Sudoku from a data file. 3. Randomly generate and solve a Sudoku. >> 3 Generated Sudoku: +---- | 53 1 - 7-1 | 6 | 1951 | -98 | | 6 8 - | 4 | 7 - ! - 6 - | 8 31 2 - 1 3 1 | 6 6 | 1 | | 4191 8 1 | 51 791 Sample solution 1: Solution 1: | 532 | 6 7 8 9 14 | | 6 7 4 | 195328|| | 19 8 3 4 2 5 6 7|| 8 ------+ -----+ | 819 7 6 4 | 253 | 426 | 853 | 7 911 | 753 | 921 | 48 6 i | 961 | 537 | 8 42 | | 287 | 419 635 | 345 | 286 | 1791 Solution 2: +------ | 5 3 2 6 7 8 9 14 | 674 | 195 | 328 | 198 34 2 567 | + | 819 764 | 253 | 426 | 853 | 791| 753 9 2 1 8 4 6 | + 961 | 537 | 482 | | 287 4 19 635 | | 3 4 5 1 2 8 6 | 17 9 | There are 18 solutions Run Again (Y/N)? y Do you wish to? 1. Enter a sudoku from the keyboard. 2. Load a sudoku from a data file. 3. Randomly generate and solve a Sudoku. >> 1 Enter a Sudoku puzzle: 0 601 0 40 50 008 3 0 5 600 200000001 800 407006 00 600 300 7009 010 04 50000002 0720690 040 50 80 70 Solution 1: +------ | 963 | 1 7 4 2 5 8 | 1 78 3 2 5 | 6 49 2 5 4 6 8 9 7311 -- + | 8 2 1 | 437 | 596 | | 496 | 8 5 2 317| | 735 | 961 | 824 | 9 COSC 2- +----- | 589 713 | 462 | | 317 | 2 46 1985 | | 4 2 | 598 | 173 | Run Again (Y/N)? Y Do you wish to? 1. Enter a sudoku from the keyboard. 2. Load a sudoku from a data file. 3. Randomly generate and solve a Sudoku. > 2 Enter the file name: sudoku.txt eeeeeee eeeeeeee1 eee9e1eee eeeeeeeee 4 10 Invalid Input Run Again (Y/N)? n Name the program: Sudokusolverxx.java or Sudokusolverxx.cpp, where XX are your initials