Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using visual basic and visual studio please provide screen shots Exercise 10-2 Enhance the Future Value application This exercise will guide you through the process

using visual basic and visual studio

please provide screen shots

Exercise 10-2 Enhance the Future Value application

This exercise will guide you through the process of adding a combo box and a list box to the Future Value application.

Open the Future Value application and add two controls

1. Open the application thats in the C:\VB 2015\Chapter 10\FutureValue directory.

2. Delete the Number of Years text box and replace it with a Number of Years combo box. Then, delete the Future Value text box and replace it with a Future Value list box. When youre done, the form should look something like the one in step 5 below.

Add the code that works with the controls

3. Generate the event handler for the Load event of the form. Then, add code that loads the numbers 1 through 20 in the Number of Years combo box, and add code that selects 3 as the default number of years.

4. Delete the code in the IsValidData procedure that refers to the Number of Years text box since it isnt needed anymore.

5. Modify the event handler for the Click event of the Calculate button so it adds the future value for each year to the Future Value list box. For example, if you calculate the future value for three years, the Future Value form should return a result like this:

6. To get this to work correctly, youll need to use the Clear method of the Items collection for the list box to clear the list box each time the Calculate button is clicked. In addition, you can use the Mod operator to add the future value after every twelve months of the calculation. For example:

If month Mod 12 = 0 Then ' add the future value to the list box

7. Test this application to make sure it works correctly.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1 reference 1 Public Class EPublic Class IfrmFutureValue Search Solution Explorer (Ctrl+) VB FutureValue 0 references My Project Private Sub btnCalculate_Click (sender As Object, -11 References 4. e As EventArgs) Handles btnCalculate.Click App.config Ea frmFutureValue.vb Try 6 If IsValidData() Then D frmFutureValue Dim monthlyInvestment As Decimal Dim yearlyInterestRate As Decimal - : Dim years As IntegerConvert.ToInt32 (txtYears.Text) 7 Convert.ToDecimal(txtMonthlyInvestment.Text) 9 18 Convert.ToDecimal (txtInterestRate.Text) Solution Explorer Tearn Explorer 12 13 14 15 16 17 18 19 20 21 Properties :Dim monthlyInterestRate As Decimal-yearlyInterestRate / 12, Dim months As Integer = years * 12 :Dim futureValue As Decimal-Me.FutureValue( monthlyInvestment, monthlyInterestRate, months) txtFutureValue. Text FormatCurrency(futureValue) txtMonthlyInvestment.Select() :End If Catch ex As Exception MessageBox.Show(ex.Message &vbCrLf & vbCrLf & 23 24 25 ex.GetType. ToString & vbCrLf & vbCrLf & ex.StackTrace, "Exception")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

At the molecular level, what is a gene? Where are genes located?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago