Question
Please use python - while loops (not for loops) In this problem, you should write one function named calculate_tree_height. The purpose of the function is
Please use python - while loops (not for loops)
In this problem, you should write one function named calculate_tree_height. The purpose of the function is to calculate how tall a tree will be in some number of years. This function should accept teo parameter variables, and return one floating-point number. The first parameter should be the current height of the tree, in feet. The second should be the number of years into the future to calculate the heightof the tree at. Each year, the height of the tree should grow to 1.2 times the height it was the previous year. Thus, if a tree is 10 feet tall, in three years it should be: 10 * 1.2 * 1.2 * 1.2 = 17.2799. The function should calculate the height based on the current height and number of years, and return the calculated height as a float, rounded to four decimals places.
- For the two parameters 5 and 10, the function should return 30.9587:
- For the two parameters 2 and 7, the function should return 7.1664:
- For the two parameters 1 and 10, the function should return 6.1917:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started