Comp 151 Project 7
Practice with recursion
Summary:
In this 7th project you will write a program to help you practice
recursion
Sat Dec 17th, 2022 at 11:59pm
Description:
Write a program that will display a menu (a command line is easiest and
something we've covered in class - if you want to do something more with
arcade because you have time time feel free)
The main purpose of this project is to
practice recursion. To that end about half of the credit will be
assigned to the three recursive functions - they have to be recursive.
The menu should give the user the following options
- Calculate Compounding interest
- collect the initial amount, and the interest rate, and the number of
years the money will be in the account from the user
- write a recursive function to calculate and return the final balance
- hint, your recursive function needs three values as parameters
(unless you are using classes in which case you might be able to use
self.variable variables for two of them)
- like in the binary search program that we did in class, only one
of those parameters needs to change to get closer to the base case.
- comment your function to show the base case(s) and recursive
case(s) for the function
- finally report the final amount of money
- Recursive list reversal
- read in items from a text file into a list
- write a recursive function (you cannot use the list.reverse
function) to reverse the order of the items in the list
- again label the base and recursive case(s) with comments
- print the resulting list.
- recursive Triangle
- ask the user how big the triangle should be
- write a recursive program which will print a right triangle of that
height and width to the screen (command line is fine)
- for example if the user types 5 then either of the versions below
would be fine
- #####
- ####
- ###
- ##
- #
- or
- #
- ##
- ###
- ####
- #####
- as before, be sure to comment your function to show the base and
recursive cases
Other Requirements
yourNameProject6
(so mine might be JSantoreProject6)
And put the following at the begining of the
python file with the main function as a comment:
Project Submission
Submit the project by putting it on github as a private
project and making me a collaborator as before.