Q [An Introduction to Programming using Visual Basic Ed 11, Ch 6.2 Q# 26]- When $1,000 is invested at 5% simple interest, the amount grows by $50 each year. When money is invested at 5% interest compounded annually, the amount at the end of the year is 1.05 times the amount at the beginning of that year. Display the amounts for 9 years for a $1,000 investment at 5% simple and compound interest.    My Answer: Private Sub btnComputeGrowthMoney_Click(sender As Object, e As EventArgs) Handles btnComputeGrowthMoney.Click         'Display simple interest and compound interest from 1 to 9         Dim simple, compound, principal As Decimal         Dim rate As Double         Dim year As Integer         lstInterest.Items.Clear()         principal = 1000         rate = 0.05         simple = principal * (1 + rate * year)         compound = principal * (1 + rate) ^ year         For year = 1 To 9             lstInterest.Items.Add("YEAR" & " " & "SIMPLE INTEREST" & " " & "COMPOUND INTEREST")             lstInterest.Items.Add(year & " " & simple.ToString("N") & " " & compound.ToString("C"))         Next     End Sub   Error message after running the script Severity Code Description     Line Suppression State Error BC30456 'Items' is not a member of 'TextBox'.     9 Active

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Q [An Introduction to Programming using Visual Basic Ed 11, Ch 6.2 Q# 26]- When $1,000 is invested at 5% simple interest, the amount grows by $50 each year. When money is invested at 5% interest compounded annually, the amount at the end of the year is 1.05 times the amount at the beginning of that year. Display the amounts for 9 years for a $1,000 investment at 5% simple and compound interest. 

 

My Answer:

Private Sub btnComputeGrowthMoney_Click(sender As Object, e As EventArgs) Handles btnComputeGrowthMoney.Click

        'Display simple interest and compound interest from 1 to 9

        Dim simple, compound, principal As Decimal

        Dim rate As Double

        Dim year As Integer

        lstInterest.Items.Clear()

        principal = 1000

        rate = 0.05

        simple = principal * (1 + rate * year)

        compound = principal * (1 + rate) ^ year

        For year = 1 To 9

            lstInterest.Items.Add("YEAR" & " " & "SIMPLE INTEREST" & " " & "COMPOUND INTEREST")

            lstInterest.Items.Add(year & " " & simple.ToString("N") & " " & compound.ToString("C"))

        Next

    End Sub

 

Error message after running the script

Severity

Code

Description

   

Line

Suppression State

Error

BC30456

'Items' is not a member of 'TextBox'.

   

9

Active

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage