CSCI 107 Assignment 8
- Due Date: Friday, November 18th no later than 11:59 p.m.
- Partner Information: You may complete this assignment individually or
with exactly one classmate.
- Submission Instructions (working alone): Upload your solution,
entitled YourFirstName-YourLastName-Assignment8.py
to the BrightSpace Assignment 8 Dropbox.
- Submission Instructions (working with one classmate): Upload your
solution, entitled
YourFirstName-YourLastName-PartnerFirstName-PartnerLastName-Assignment8.py
to the BrightSpace Assignment 8 Dropbox. Note: If you work with a
partner, only one person needs to submit a solution. If you both
submit a solution, the submission that will be graded is the one from
the partner whose last name comes alphabetically first.
- Deadline Reminder: Once the submission deadline passes, BrightSpace
will no longer accept your submission and you will no longer be able
to earn credit. Thus, if you are not able to fully complete the
assignment, submit whatever you have before the deadline so that
partial credit can be earned.
Estimating e
The purpose of this assignment is to help you gain experience using
recursion to solve problems.
Isaac Newton developed the following method to estimate e
(the natural logarithm):
For this assignment, write a program that asks
the user how many terms to use and then estimates e using
Newton's Method.
Here are four different runs of the program:
Requirements and Grading
- 20 points - A function to calculate the
factorial
of a number
(e.g. n!) is implemented using recursion
(all or nothing).
- 20 points - A function to estimate e (that calls the factorial function)
is implemented using recursion (all or nothing).
- 25 points - The estimates of e are correct and the two functions
above are implemented recursively (all or nothing).
- 15 points - The Python code is of high quality, e.g. functions are
used appropriately, variable names are meaningful, etc. (3 points
for each type of improvement possible).
- 10 points - The format of the transcript above is matched exactly.
You may assume that the user will enter a non-negative integer
when prompted for the number of terms in the estimation.
(3 points for each type of improvement possible).
- 10 points - Comments are used appropriately (3 points for each
type of improvement possible).