Download the homework template, template.py. This template contains some lines at the top that you and your partner should fill in. Failure to use the template may result in loss of points on the assignment.
For each of the files that you are to create, just save a copy of the template under that name.
This will be a precondition for every assignment where you program
in Python.
You are contacted by Dr. Jan Crouter who is the chair of the
Economics department at Whitman College. Her department has a new professor of finance. The new professor will need a general
tool that their students can use to compute compound interest.
Dr. Crouter tells you the program should take the following inputs from the user:
The program should calculate and print the final amount of the
investment, with interest, after the specified number of years have
elapsed.
Note: Your program should ask for the inputs in the order specified. Failure to following this ordering will result in some point deduction.
Hint: The formula for computing compound interest is given in exercise 2.4.4. You may have already written a solution for a special case of this problem.I think Mad Libs™ are hilarious. Please write me a Mad Lib similar to the one in exercise 2.4.13. Your program should request at least five words from the user.
If you adapt a story from another source, make sure to cite that source in a comment in your program. Comments are meant for humans to read, rather than the computer. In Python, comments look like this:
# This is a short comment.
"""
This is a long ...
... long ...
... long comment.
"""
Of course, you are welcome to write your own story from scratch.
Submit two files, interest.py
and madlibs.py
,
using the turnin form.
Again, if you have any problems here, don't hesitate to ask your professor, or the lab aides or class mentors.
Created September 2, 2016
Last revisedSeptember 09, 2016, 01:57:07 PM PDT
This work is licensed under a Creative
Commons Attribution-Noncommercial-Share Alike 3.0 United States License.