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.

the program will display a Latin square.  Cycle through the steps to incrementally develop your program: o Edit your program to add new capabilities.  Use the handin system to turn in the first version of your program. . Under all circumstances. 2. If the number is invalid. the program will display the message “Program halted” immediately before execution ends. o Run the program and fix any errors. 4. If the order is valid. To clarify the project specifications. once the discussion turns to Python specifics and the subsequent writing of Python statements. the program will display and appropriate message and halt. Run the program and track down any errors. In case of problems with electronic submission.  Write a simple version of the program. you will need to copy it to your CSE file space before the deadline. You cannot write a program until you have figured out how to solve the problem. Suggested Procedure  Solve the problem using pencil and paper first. However.  Use the handin system to submit your final version. an archived copy in the CSE file space is the only acceptable evidence of completion. This first step is best done collaboratively with another student. 5.3. 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.  Be sure to log out when you leave the room. you must work on your own. if you’re working in a public lab. Assignment Notes 1. Your program must accept user inputs in the order specified. the program will prompt the user to enter the number to be placed in the top-left corner of the Latin square. sample output is provided at the end of this document. If the top-left number is valid.

Sample Output .