Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

One easy python question, can anyone help me to solve it and show me a code screenshot? Question 3 (10 points): Purpose: To build a

One easy python question, can anyone help me to solve it and show me a code screenshot?image text in transcribedimage text in transcribed

Question 3 (10 points): Purpose: To build a program and test it. To get warmed up with Python, in case you are using it for the first ime Degree of Difficulty: Moderate. Don't leave this to the last minute. The basic functionality is easy. There are aspects of the problem that you won't appreciate until you start testing. A Latin Square is an arrangement of numbers 1 to N in a square, so that every row and column contain all the numbers from 1 to N. The order of the numbers in a row or column does not matter. Below are two squares, but only one of them is a Latin Square. 1 23 3 21 3 31 The square on the left is a Latin Square for the numbers 12.3, whose rows consist of the numbers 12,3 (in any order) and whose columns consist of the numbers 1.2,3 (in any order). On the right, is a 3 x 3 square of numbers that is almost a Latin Square, but the bottom row is missing the value 2. and the column on the right is also missing the value 2. There are Latin squares of all sizes. Definition: ANx N Latin square is formally defined by the following criteria: Every row contains the numbers 1 through N exactly once, in any order Every column contains the numbers 1 through N exactly once, in any order When the Latin square is N x N we say that it has order N. The order tells us which numbers to look for, and how big the square is In this question you will implement a program that checks whether a N x N square of numbers is a Latin Square or not. Your program should work by reading input from the console, and sending an answer to the console, as in the following example: . It reads a number N on a line by itself This will be the order of a Latin square. The order must be a positive integer, e.g. N> 0. . It reads N lines of N of numbers, ie., it reads console input for a square of numbers. e It checks whether the sequence of numbers is a Latin square or not. Your program should display the message yes" if it satisfies the above criteria, or "no" if it does not. What to Hand In . Your implementation of the program: a1q3.py . A text document called a1q3 demo.txt, showing at least six (6) demonstrations of your program work ing on 3 examples that are true Latin squares, and 3 examples that are not Latin squares. This is a demonstration, not testing. . If you wrote a test script, hand that in too. calling it a1q3_testing.txt Be sure to include your name, NSID, student number, course number and laboratory section at the top of Question 4 (10 points) Purpose: To reflect on the work of programming for Question 3. To practice objectively assessing the quality of the software you write. To practice visualizing improvements, without implementing im- provements. Degree of Difficulty: Easy Answer the following questions about your experience implementing the program in Question 3. You may use point form, and informal language. Just comment on your perceptions: you do not have to give really deep answers. Be brief. These are not deep questions; a couple of sentences or so ought to do it. 1 (2 marks) Comment on your program's correctness. How confident are you that your program (or the functions that you completed) is correct? 2. (2 marks) Comment on your program's efficiency. How confident are you that your program is reason ably efficient? 3. (2 marks) Comment on your program's reusability. For example, did you re-use any code from a dif- ferent project (maybe Q1? How easy would it be to re-use any part of your program for another task? 4. (2 marks) Comment on your program's robustness. Can you identify places where your program might behave badly. even though you've done your best to make it correct? You do not have to fix anything 5. (2 marks) How much time did you spend writing your program? Did it take longer or shorter than you You are not being asked to defend your program as being good in all these considerations. For example, you mention here expected? If anything surprised you about this task, explain why it surprised you. if your program is not very robust, you can say that you don't need to make it robust What to Hand In Your answers to the above questions in the text file called a1 reflections.txt (PDF, rtf, docx or doc are acceptable). This is the same document you used for Q2. Please help the marker by clearly indicating the question number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions