Sunteți pe pagina 1din 3

VERSION 5.

00
Begin VB.Form lst
Caption = "Form1"
ClientHeight = 4410
ClientLeft = 120
ClientTop = 450
ClientWidth = 12420
LinkTopic = "Form1"
ScaleHeight = 4410
ScaleWidth = 12420
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdlimpiar
Caption = "limpiar"
Height = 495
Left = 4200
TabIndex = 11
Top = 3240
Width = 1335
End
Begin VB.ListBox List2
Height = 1815
Left = 9960
TabIndex = 5
Top = 600
Width = 1335
End
Begin VB.ListBox List1
Height = 1815
Left = 8040
TabIndex = 4
Top = 600
Width = 975
End
Begin VB.CommandButton cmdcalcular
Caption = "calcular"
Height = 615
Left = 600
TabIndex = 3
Top = 3120
Width = 2415
End
Begin VB.TextBox txtao
Height = 375
Left = 360
TabIndex = 2
Top = 2040
Width = 2055
End
Begin VB.TextBox txtinteres
Height = 495
Left = 480
TabIndex = 1
Top = 1200
Width = 1935
End
Begin VB.TextBox txtmonto
Height = 285
Left = 480
TabIndex = 0
Top = 480
Width = 1935
End
Begin VB.Label lblmontoacumulado
Caption = "monto acumulado"
Height = 975
Left = 10080
TabIndex = 10
Top = 2880
Width = 1455
End
Begin VB.Label lblmonto
Caption = "monto"
Height = 855
Index = 1
Left = 7920
TabIndex = 9
Top = 2880
Width = 1335
End
Begin VB.Label lblao
Caption = "ao"
Height = 255
Left = 3000
TabIndex = 8
Top = 2040
Width = 1215
End
Begin VB.Label lblinteres
Caption = "interes"
Height = 375
Left = 3000
TabIndex = 7
Top = 1200
Width = 1335
End
Begin VB.Label lblmonto
Caption = "monto"
Height = 255
Index = 0
Left = 3120
TabIndex = 6
Top = 480
Width = 975
End
End
Attribute VB_Name = "lst"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim p, f, i, s As Double
Dim n, j As Integer
Private Sub cmdcalcular_Click()
p = Val(Me.txtmonto.Text)
i = Val(Me.txtinteres.Text)
n = Val(Me.txtao.Text)
For j = 1 To n
f = p * (i + 1) ^ j
Me.List1.AddItem (f)
s = s + f
Me.List2.AddItem (s)

Next j

End Sub
Private Sub cmdlimpiar_Click()
Me.List1.Clear
Me.List2.Clear
Me.txtmonto.Text = ""
Me.txtinteres.Text = ""
Me.txtao.Text = ""
End Sub

S-ar putea să vă placă și