Simulate a program by hand. Consider the following program for computing with interest rates:
(a)Explain with words what type of mathematical problem that is solved by this program. Compare this computerized solution with the technique your high school math teacher would prefer.
(b)Use a pocket calculator (or use an interactive Python shell as substitute) and work through the program by hand. Write down the value of amount and years in each pass of the loop.
(c)Change the value of p to 5. Why will the loop now run forever? (See Exercise 2.12 for how to stop the program if you try to run it.) Make the program more robust against such errors.
(d)Make use of the operator += wherever possible in the program
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here