This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: COMP 140: Computational Thinking Homework 1: The devil and Daniel Webster Assigned: 8/31/09, Due: 10PM, 9/7/09 Be sure to carefully read the course policies for assignments on the course web site: http://www.clear.rice.edu/comp140/ The basic code for running the webster problem is provided on the course web site as webster.py . You may use and modify this code any way you like. Your assignment should be turned in via Owlspace. You should turn in two files: netid-hw1.py and netid- hw1.txt. netid should be replaced with your netid ( i.e. , rixner-hw1.py and rixner-hw1.txt). All Python code you write should be contained within the .py file. Add comments into the file (lines starting with a #) to indicate which problem is being solved. All text that you write should be contained within the .txt file, clearly marking which problem you are writing about. Both files should also have your name an netid on the first line (in a comment in the .py file). Problem 1 In this assignment, we will explore two variations of the devil and Daniel Webster problem. Part A: Suppose Webster wants out of the deal on the day before his salary is less than zero. Compute when Webster should quit working for the devil, so he can make the following counteroffer: I will take your starting salary of $1000, give you a starting commission of $100, and follow your other rules, but I will quite on the t-th day.-th day....
View Full Document
This note was uploaded on 09/26/2010 for the course COMP 140 taught by Professor Devika during the Fall '10 term at Rice.
- Fall '10