Assignment 3 - Mon Chef-d’Oeuvre!

pdf

School

Simon Fraser University *

*We aren’t endorsed by this school

Course

120

Subject

Computer Science

Date

Oct 30, 2023

Type

pdf

Pages

5

Uploaded by xiaofanfan

Report
Assignment 3 - Mon Chef-d’Oeuvre! Due Wednesday by 11:59p.m. Points 20 Submitting a file upload File Types py Available Oct 14 at 8p.m. - Oct 25 at 11:59p.m. Start Assignment Title: Assignment 3 - Mon Chef-d’Oeuvre ! Step 1 - Problem Statement Write a Python program, called MonChefDoeuvre1237.py, to create a drawing inspired from the work of a known painter (artist) using the Python Turtle module and its built-in functions. You must create and use at least one turtle from this module to create your drawing. To illustrate what this assignment is asking you to do, here is the chef d’oeuvre created by a CMPT 120 student from a previous semester: inspired by Van Gogh's famous painting Starry Night:
Awesome, isn't it! :) Your program, for Assignment 3, must also satisfy the following requirements. Requirements: 1. Your program must execute as expected on Python 3.11 IDLE and it must start when the menu option Run is selected or F5 is pressed. 2. Your program must not require input from the user in order to completely execute. This is to say that the user must not be prompted for any input data once your program has started executing, it must execute all on its own until it reaches its end. 3. The last statement in your program must call the turtle function (method) exitonclick( ) as presented in our lectures. 4. Your drawing must not be larger than the default Python canvas size of 700 x 650 , i.e., your drawing must be displayed in its entirety in the Python canvas without having the viewer (the TA) either resizing the Python canvas or having to use the scroll bars in order to view your drawing. To help you visualize a Python canvas too small, download and execute the program Turtle_Canvas_Too_Small.py (https://canvas.sfu.ca/courses/79704/files/22426243?wrap=1) (https://canvas.sfu.ca/courses/79704/files/22426243/download?download_frd=1) . 5. You cannot make use of Python modules that need to be downloaded on a computer before they can be used. You can only use Python modules that are already available on Python 3.11 IDLE (available by simply using the Python statement import in your Python program). 6. Your drawing must be composed of at least thirty (30) shapes. To help you determine what a "shape" is in a Turtle drawing, download and execute the program Turtle_Shapes.py (https://canvas.sfu.ca/courses/79704/files/22426244?wrap=1) (https://canvas.sfu.ca/courses/79704/files/22426244/download?download_frd=1) . The drawing created by this program consists of nine (9) shapes: 2 rectangles
1 square 3 circles 2 semi circles (note that 2 semi circles drawn together count as 1 shape, but here, the 2 semi circles are not drawn together so they count as 2 shapes) 1 quarter of a circle. 7. Some of the shapes your program draws must be filled in. For example, the rightmost rectangle in the drawing produced by the program Turtle_Shapes.py (the one with the "yellow" contour) is filled in with the colour called "hot pink". 8. Your drawing must include at least ten (10) colours. Looking at the drawing the program Turtle_Shapes.py generates, you can count eight (8) colours (nine (9) if you include "white"). 9. Your program must include at least five (5) for loops. Looking at the program Turtle_Shapes.py , you can count two (2) for loops. 10. Your program must include at least six (6) functions : Four (4) of these functions must be void functions, i.e., functions that do not return any values. Our e-textbook calls these void functions non-fruitful and it says that they return the value "None". Note that these four (4) functions may or may not require parameters. Five (5) of these functions must require parameters (the number of parameters is up to you). Note that these five (5) functions may or may not be void . Looking at the program Turtle_Shapes.py , we can count three (3) void functions that require parameters. You must apply the Generalization Principle when creating your functions as much as you can. This is to say that you must design your functions in a general fashion (perhaps using parameters and/or returned value) such that they can solve several similar problems. Your code must call each of your functions at least once, either from the Main part of your program, and/or from your other functions. All your functions must terminate with a return statement. 11. Your program must not contain repeated code: i.e. statements that look exactly the same and are repeated several times in your program. 12. You can use while loops in your program. However, your while loops must make use of a Boolean condition (i.e., Boolean expression) which must evaluate to True or False depending on the value assigned to the variable(s) contained in this Boolean expression. You cannot use break or exit( ) function as part of the body of your while loop. Also, you must use while loops only in situations when you do not know how many times your code needs to iterate. You must use for loops only in situations when you do know how many times your code needs to iterate. 13. You must include a header comment block at the top of your program containing the four (4) sections we talked about in our lectures: filename description author date 14. For this assignment, you also need to add the following to your header comment block:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
the name of the artist the name of her/his chef d’oeuvre that inspired your drawing whether we would like to have your chef d’oeuvre show cased (displayed) in class 15. Your program must follow these Good Programming Style (GPS) rules : Functions and variables must always be named in a descriptive fashion (describing their purpose). All import statements must be placed at the top of the file, immediately after the header comment block, before the functions. Modules must only be included once per file . Each line of your code must not exceed 80 characters in length. Step 2 - Design Design your algorithm using English (natural language) or using pseudocode. Requirement You must include your algorithm as comments in your program. Step 3 - Implementation Then translate each of the steps of your algorithm (each comment) to Python code. Requirement You must leave the comments in the code. Step 4 - Testing Incremental development: Implement and test your Python program in an incremental fashion, i.e., implement a feature at a time (perhaps a function), then test it. Move on to the implementation of the next feature only once the previous one has been successfully tested. This incremental software development strategy is in contrast with the “Big Bang” approach (https://lameguy.wordpress.com/2013/05/29/the-big-bang-software-development-lifecycle-model/) where the whole program is written in one go and only tested at the end. This approach often leads to lengthy debugging sessions and a lot of frustration :( Art Gallery After the due date, we shall have Art Gallery moments at the beginning of our lectures in which we shall present chef d’oeuvres . So, if you are proud of what you created in this assignment and wish to have your chef d’oeuvre presented in class, please, let the instructor know by saying so on the very last line of your header comment block. Submission You can submit your program to Canvas as many times as you wish until the due time on the due date. There are no extension granted unless for medical reason and once the Official Medical Certificate (https://canvas.sfu.ca/courses/79704/files/22229208?wrap=1) has been completed and emailed to the instructor.
How your Assignment 3 will be marked When the TA marks Assignment 3, they will be looking at whether your program solves the problem (10 marks), whether your program satisfies all the requirements stated in this assignment (10 marks), regardless of whether or not your program executes. The rubric for Assignment 3 is based on the above. Make sure your program satisfies the above before submitting your Assignment 3. Since the drawing you create in this assignment is completely up to you (and your muse ), no two drawings will be similar! Enjoy the creative process!

Browse Popular Homework Q&A

Q: Let O -4 Compute the indicated matrix. (If this is not possible, enter DNE in any single blank). A +…
Q: Define outsourcing and provide the two big drivers of outsourcing
Q: Find the equation of the line that passes through the point (2,−4) and is perpendicular to the line…
Q: A clothing business finds there is a linear relationship between the number of shirts, n, it can…
Q: The sequence of pizza numbers (Pn)n≥o (the maximal number of pieces formed when slicing a pizza with…
Q: Determine whether the angle between u and v is acute, obtuse, or a right angle.
Q: Write a balanced equation to represent the reaction shown. H HT H Н C H H S-H Н H-C-S. H C-H Н нан…
Q: An ideal gas passes a diffuser. At the diffuser inlet, the temperature is T1 = 350.00 K, the…
Q: Give bases for row(A), col(A), and null(A). 1 1 -4 0 2 1 1 -1 -5 row (A) col(A) null(A) A =
Q: According to a study, 51% of all males between the ages of 18 and 24 live at home. (Unmarried…
Q: Z is distributed as a standard normal variable. Calculate the following probability using Excel.…
Q: Use Snell's law to find the angle that a beam of light makes with the normal to a class surface,…
Q: Problem 1: A scientist measuring the resistivity of a new metal alloy left her ammeter in another…
Q: remains positive. It is modeled by the function e-t. alue of in the long run.
Q: < H 1 Q 1 H -I H 8:00:0 H-J-H 1. 2. 4. 3. see-saw 5. 6. 7. octahedral trigonal bipyramidal 8.…
Q: A capacitor with a capacitance of 32 microfarads is discharged through a resistance of 53 kilo-ohms.…
Q: Glycogen synthase in the liver is a target for phosphorylation by two protein kinases. What are…
Q: A 1500 kg elevator, suspended by a single cable with tension 16.0 kN, is measured to be moving…
Q: Determine the area under the standard norm (a) Z= -0.09, (b) Z= -1.47, (c) Z= - 1.19,
Q: Match each description with its most appropriate measure. Not all terms will be used. Determine what…
Q: Experiment #4 - Determine the mass of each of the carts used in the experiment Set up the carts so…
Q: There are four primary international strategies. Write a paragraph explains why they are important…