CSC 160 Fall 2015 - Homework #2 (100 points)
Assigned Sept 9, due MON Sept 21
Assignments submitted on Moodle with time stamps during
class time (Mon or Wed 4:15-5:40pm) will be given a grade of ZERO.
[50 pts.] Chapter 2B
Review Sections 2.1-2.4 of the textbook.
Read Section 2.5 of the textbook.
Do Discussion Question 1 on page 52:
List and describe in your own words the six steps in the software development process.
Use Steps 1-5 of the Software Development Process to:
Write a program that converts temperatures from Fahrenheit to Celsius. [Hint: Use the formula C = (5/9)(F-32).]
[50 pts.] Chapter 2C
Read Sections 2.6-2.8 of the textbook.
Do Discussion Question 7 on page 53:
What do you think will happen if the following code is executed?
print("start")
for i in range(0):
print("Hello")
print("end")
Explain why this is your expectation. Look at the flowchart for the for statement on page 46 to help you figure this out.
Use Steps 1-5 of the Software Development Process to:
Write a program that asks the user for a number and prints out the next 5 numbers in that times table. For example, if the user inputs the number 3, the program returns 6 9 12 15 18.
Submitting your Assignment
For the Discussion questions, you can submit them on paper in class or through the HW2 link on Moodle using the filename "hw2paper-LASTNAME".
For the chapter 2B programming exercise, submit each step as follows:
Steps 1-4: Submit your module file with the filename "ch2bFtoC-LASTNAME.py". Steps 1-3 need to be commented out.
Step 5: Submit your shell file with the filename "ch2bTest-LASTNAME.py". This file must include at least 2 tests of your program.
For the chapter 2C programming exercise, submit each step as follows:
Steps 1-4: Submit your module file with the filename "ch2cTimesTable-LASTNAME.py". Steps 1-3 need to be commented out.
Step 5: Submit your shell file with the filename "ch2cTest-LASTNAME.py". This file must include at least 2 tests of your program.
Last Modified: 9/13/15