Question
C# code - How to build a program that computes future value and checks for format exceptions. When this program runs, user types four fvalues:
C# code - How to build a program that computes future value and checks for format exceptions.
When this program runs, user types four fvalues: initial investment, interest rate in the ext boxes next to First set of values and Second set of values.
When the user clicks the button "Fill Manximum and Minimum Values the following should happen:
First your program should check each of the four values the user entered whether they are correct numbers; if not you should catch the FormatException. If all of the numbers are in correct format, your program should check whether each of them is greater than zero. If any of the numbers is less than or equal to zero, your code showd throw an exception.
Second your code should compute the maximum of the two investment values and place them in the investment textbox next to Maximum Values. Similarly the minimum of the two investment values should be placed in the investment textbo next to Minimum VAlues. Repeat this exercise to compute and fill the minimum and maximum interest rates.
3. When the user clicks the button "Compute Future VAlue in Ten Years with Maximum Values" the following should happen:
Compute the future value of the investment in Ten years using the Maximum Values for initial investment and interest rate. Fill the textbox next to Future VAlue with Maximum VAlues. (Try Catch)
4. When the user clicks the button Compute Future Value in Ten Years with Minimum VAlues the following should happen:
Compute the future value of the investment in Ten years using the minimum values for initial investment and interest rate. Fill the textbox next to Future VAlue with Minimum Values
5. Code method CalculateFutureVAlue with three input parameters: int years, decimal investment, decimal rate. This method should return a decimal number with future value. Modify the button click method in items (3) and (4) above to use this CalculateFutureValue method.
FutureValue Initial Investment Interest Rate First Set of Values: Second Set of Values Maximum Values Minimum Values: Fill Maximum and Minimum Values Future Value with Maximum Values: Future Value with Minimum Values: Compute Future Value in Ten Years with Maximum Compute Future Value in Ten Years with Minimum ExitStep 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