Assigned Date: Monday, Feb. 1, 2021
Due Date: Wednesday, Feb. 10
Due Time: 30 mins before class
Assignment
Find a complete, interesting melody.
Write a Python program that plays it.
Submissions
Do all three:
- Upload a PDF (or photo from your smartphone) with the music score of the melody, together with your pencil writings of Python note pitches and durations (see Fig. 2.3 in textbook, as an example).
- Upload your program file on OAKS.
- Be ready to perform it in class, on the due date.
Your program should have a meaningful name, e.g., stairwayToHeavenMelody.py.
Program Documentation
The Golden Rule of Style: “A program should be as easy for a human being to read and understand as it is for a computer to execute.” [1]
Your code should have general comments at the top, which explain what the program does. Look at the book examples here.
You should comment all variables, obscure statements, and blocks of code.
Copy and paste the following into the top of your program. Update it, to fit what your program does.
# nameOfYourProgram-MakeSureYouUpdateThis.py # # Author: Your full name # Email: Your school email # Class: The class you are in # Assignment: Homework #1 # Due Date: The due date # # Purpose: Describe what the program does. # # Input: Describe the input to the program. # # Output: Describe the output of the program. #
Grading
Your grade will be based on how well you followed the above instructions, and the depth/quality of your work.
Reference
- Cooper, D. and Clancy, M. (1985) “Oh! Pascal”, 2nd ed., W.W. Norton & Company, New York, p. 42.