Question: In this exercise, you ll modify the Future Value program so the user can t cause the program to crash by entering an invalid int

In this exercise, youll modify the Future Value program so the user cant cause the program to crash by entering an invalid int or float value. 1. In IDLE, open the future_value.py file thats in this folder: python/exercises/ch08
2. Review the code and study the get_number() and get_integer() functions. Note that they receive three arguments: the prompt for a user entry, the low value that the entry must be greater than, and the high value that the entry must be less than or equal to. Then, review the calling statements in the main() function and note how these functions are used.
3. Test the program. Note that you can cause the program to crash by entering values that cant be converted to float and int values.
4. Add exception handling to the get_number() and get_integer() functions so the user has to enter valid float and int values. Then, test these changes to make sure the exception handling and the data validation work correctly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!