CSSE 120 -- Intro. to Software Development
Homework 2
- Complete the assigned reading for the next session, Zelle,
§ 2.5 - 2.8.
- (32 pts) Complete the ANGEL quiz over the reading for the next
session. You'll find this on the CSSE 120
ANGEL page, under
Lessons → Homework → Homework 2 → Writing Simple Programs
Note: the due date of all programming problems
assigned on a Wednesday of any week will automatically
be extended 24 hours.
The workload in this course is high, and we want you to have at
least 48 hours to complete every assignment. This applies
only to programming problems,
not to ANGEL quizzes, surveys, etc.
We recommend that you try to complete the programs assigned on
Wednesday before the next class meeting, but we do not
require you to do so
| Day assigned |
Programs due |
Other parts of assignment due |
| Monday |
Wednesday |
Wednesday |
| Wednesday |
Friday |
Thursday |
| Thursday |
Monday |
Monday |
Note that the due time for all quizzes, programs, and other homework is the same time of day as the beginning of your class meetings.
I.e. 12:40 for Section 1 and 2:30 for Section 2
- (5 pts)
Complete Programming Exercise 1.3 on page 23 of Zelle. Write
your 1 paragraph essay in a text file named
homework2.txt. You do not have to include the code that you wrote, just your paragraph.
- (5 pts)
Complete Programming Exercise 1.5 on page 23 of Zelle, in a file
called
chaosTable.py
- (10 pts)
Implement a Python program that calculates the distance between two points. Name your program
pythagoras.py. Your program should:
- Prompt the user to enter the x and y coordinates for two points.
- Use the math module to calculate the distance between the points. (If you don't remember how to import the math library, see
the transcript from Session 1.) You'll find the
sqrt
function helpful.
- Display the distance between the points, with a descriptive label.
- Optional Bonus Problem (5 pts) During a
previous offering of this course, a small group
of students requested that we add some more challenging problems. If you found the other ones
really easy, you may want to try Programming Exercise 1.6 on page 23
of Zelle -- completing it correctly will earn you a small number of
bonus points. We realize that the homework in this class is
sometimes long, thus this is optional. Name your program
chaosTableBonus.py.
-
Turn-in instructions:
- Find the drop boxes on the course ANGEL page, under Lessons → Homework → Homework 2
- Upload your:
- homework2.txt
file and
chaosTable.py files to the
HW2 Drop Box on ANGEL
- pythagoras.py
program to the Pythagoras Drop Box
on ANGEL
- and chaosTableBonus.py program to the
ChaosTable
(Bonus Problem) Drop Box on ANGEL, if you chose to do it
- Web links, bacon, eggs, and spam:
The Python programming language was named after the English comedy team Monty Python. The Python community on-line is fond of making "in-joke" reference to various Monty Python sketches. One of today's in class examples was a reference to the legendary
Dead Parrot Sketch.
Watch the five minutes 33 seconds video and start to become a member of the Python community!