You are on page 1of 3

CSE 231

Fall 2014

Computer Project #3
Assignment Overview
This assignment focuses on the design, implementation and testing of a Python program to
display Latin squares (see below).
It is worth 30 points (3% of course grade) and must be completed no later than 11:59 PM on
Monday, September 22.
Assignment Deliverable
The deliverable for this assignment is the following file:
proj03.py the source code for your Python program
Be sure to use the specified file name and to submit it for grading via the handin system before
the project deadline.
Assignment Background
A Latin square is an N x N table filled with different symbols in such a way that each symbol
appears exactly once in each row and exactly once in each column. See the Wikipedia entry for
additional information:
http://en.wikipedia.org/wiki/Latin_square
For example, two possible Latin Squares of order 6 are shown below:
123456
234561
345612
456123
561234
612345

345612
456123
561234
612345
123456
234561

Note that the top-left numbers are 1 and 3, respectively.


Assignment Specifications
1. You will develop a Python program which displays a Latin square, based on parameters
supplied by the user (the order of the square and the number in the top-left corner).
2. The program will prompt the user to enter the order of the Latin square. If the order is invalid
(a value outside the range 1 to 9), the program will display an appropriate message and halt.

3. If the order is valid, the program will prompt the user to enter the number to be placed in the
top-left corner of the Latin square. If the number is invalid, the program will display and
appropriate message and halt.
4. If the top-left number is valid, the program will display a Latin square.
5. Under all circumstances, the program will display the message Program halted immediately
before execution ends.
Assignment Notes
1. To clarify the project specifications, sample output is provided at the end of this document.
2. Your program must accept user inputs in the order specified.
Suggested Procedure

Solve the problem using pencil and paper first. You cannot write a program until you
have figured out how to solve the problem. This first step is best done collaboratively
with another student. However, once the discussion turns to Python specifics and the
subsequent writing of Python statements, you must work on your own.

Write a simple version of the program. Run the program and track down any errors.

Use the handin system to turn in the first version of your program.

Cycle through the steps to incrementally develop your program:


o Edit your program to add new capabilities.
o Run the program and fix any errors.

Use the handin system to submit your final version.

Be sure to log out when you leave the room, if youre working in a public lab.

Be sure to save a copy of your completed program in your CSE file space (H: drive on the lab
machines) before the project deadline. If you write your program at home and turn it in from
home, you will need to copy it to your CSE file space before the deadline. In case of problems
with electronic submission, an archived copy in the CSE file space is the only acceptable
evidence of completion.

Sample Output

You might also like