Latin squares - puzzle

Assignment Help JAVA Programming
Reference no: EM13552177

Latin squares is a puzzle that is played on a square grid of squares. The purpose of the puzzle is to enter a digit in each square in such a way that no row contains any duplicates and no columns contain duplicates. For example, in a 3 by 3 grid using the digits 1, 2 and 3, the following is a sample Latin square solution.

Of course, this is not the only possible solution for a 3 by 3 Latin square.

For this program, the user is presented with a GUI like the one to the right. The top row of six text fields allow the user to specify the six symbols to be used in the Latin square. The user is expected to enter six different symbols in these fields. (In the sample the p, i, g, l, e , t
characters are shown.) The 6 by 6 grid of text fields is for two purposes: (1) to allow the user to restrict the puzzle by entering characters (2) for your program to complete a solution by filling in the empty fields.

1389_Puzzle.png

A class called LatinSquareGUI is supplied to create an interact with this window. You will need to supply the buttons. The top[ two buttons are required for a 20-point program.

Clicking the Clear button causes the 6 by 6 grid to be cleared to all empty.

Clicking the Solve button causes the program to display a single solution by using only the symbols from the top row of six text fields in such a way that the non-empty grid symbols are not altered. If a solution exists, the gird must be updated to display this solution. If no solution is possible, then the grid remains unaltered.

Add the third button as shown above. In this case the Solve button does not display the solution, but rather it prints a message (to the right of the Solve button). This message indicates how many different solutions are possible for the Latin square given the constraints. Clicking the Display Solution button causes one of the solutions found by the most recent Solve click to be displayed.

Reference no: EM13552177

Questions Cloud

Provide a rationale for your response. : Provide a rationale for your response.
Determine both the reflectance and transmittance : Light in air is incident perpendicularly on a sheet of crown glass having an index of refraction of 1.522. Determine both the reflectance and transmittance
Define a particular brand of gasoline has a density : A particular brand of gasoline has a density of 0.737 g/mL at 25 c how many grams of this gasoline would fill a 12.4 gal tank
Estimate what is the rockets thrust : A rocket, which is in deep space and initially at rest relative to an inertial reference frame, has a mass of 53.1 x 10^5 kg, of which 3.81 x 10^5 kg is fuel. What is the rocket's thrust
Latin squares - puzzle : Solve button causes the program to display a single solution by using only the symbols from the top row of six text fields in such a way that the non-empty grid symbols are not altered.
Evaluate the rms voltage of the source : A source delivers an AC voltage of the form ?v = 98.0 sin (80?t), where ?v is in volts and t is in seconds, to a capacitor. The maximum current in the circuit is 0.500 A. Find the rms voltage of the source
An organic juicing company with retail stores : An organic juicing company with retail stores and is also the manufacturer and distribution company in San Antonio, Texas.
Calculate how much charge flows through the light bulb : A 12 V battery (which has an electric potential difference of 12 V between its terminals) is connected to a 10 W light bulb for 1 second. Calculate how much charge flows through the light bulb in the 1 second.
Explain how many covalent bonds with other atoms : How many covalent bonds with other atoms will a sulfur atom with 6 electrons in it's outer shell most likely make, and why

Reviews

Write a Review

JAVA Programming Questions & Answers

  Calculates the cost of a mortgage

Write a class called Mortgage that calculates the cost of a mortgage. Prompt the user to enter the principal amount, the term in years, and the interest rate per year.

  You have to create a world class that contains a 2d array

you have to create a world class that contains a 2d array then create an abstract class called organism that contains

  Create a gui version of the game mini sudoku.

Each row has the numbers 1 to 6,Each column has the numbers 1 to 6,Each group of 2 rows by 3 columns also has the numbers 1 to 6.

  Uses a 2-d array to store the highest and lowest temperature

Write a program that uses a 2-D array to store the highest and lowest temperatures for each montjh of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of ..

  Allow the user to display a work history report

The 'report screen' shall:Allow the user to display a work history report for an individual or for all employees for the two weeks prior to the report request.

  Variable is named res and is used to input a resistanc

Assume the existence of the following Java GUI application. There are two text fields for user input. The first JTextField variable is named res and is used to input a resistance value in ohms. The second JTextField variable named cap is used to..

  Determine the example of a javascriptr framework in the

what is an example of a javascriptr framework? in the framework you have described what is an example of an application

  Considered to be an improved version

Part (c) is considered to be an improved version of Part (b). You may use an array (2-dimessional) to store some values that has been computed during the run so that when making recursive calls the program does not compute certain values over and ..

  Use either an array or a linked list

Use either an Array or a Linked List as an underlying data structure. Of course you need to create class Array or class LinedList in order to implement the methods like mergeSort(), merge(), etc

  Integers as a parameter and returns the number

Write a method maxOccurrences that accepts a list of integers as a parameter and returns the number the number of times the most frequently occurring integer

  Application for an animal-fur trimming service

Create an application for an animal-fur trimming service. Write the code for the application. Prompt the user to indicate how many animals. Display the total fee for one year. Be pleasant in your output as it will be expensive.

  Program that allows the user to enter the last names

Write a program that allows the user to enter the last names of 5 candidates in a college election and the votes received by each candidate. The program should then output each candidates name, the votes reveived by that candidate

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd