You are on page 1of 5

Public Class Form1

Dim r1, r2, r3, r4 As Double


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles TextBoxCalcular.Click
r1 = Val(TextBox1.Text) + Val(TextBox2.Text)
Suma.Text = r1
r2 = Val(TextBox1.Text) - Val(TextBox2.Text)
Resta.Text = r2
r3 = Val(TextBox1.Text) * Val(TextBox2.Text)
Multiplicacion.Text = r3
r4 = Val(TextBox1.Text) / Val(TextBox2.Text)
Division.Text = r4
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Suma.Text = ""
Resta.Text = ""
Multiplicacion.Text = ""
Division.Text = ""
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.Focus()
End Sub
End Class

Public Class Form2


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Convertir.Click

Dim i, j As Integer
i=0
Dim max(100, 100) As String
Dim cont As Integer = 0
Dim alma As Integer = 0
If (Len(TextBoxEntero.Text) >= 1) Then
For i = 1 To Len(TextBoxEntero.Text)
cont += 1
Next
End If
max(0, 0) = "M"
max(0, 1) = 1000
max(1, 0) = "CM"
max(1, 1) = 900
max(2, 0) = "D"
max(2, 1) = 500
max(3, 0) = "CD"
max(3, 1) = 400
max(4, 0) = "C"
max(4, 1) = 100
max(5, 0) = "XC"
max(5, 1) = 90
max(6, 0) = "L"
max(6, 1) = 50
max(7, 0) = "XL"
max(7, 1) = 40
max(8, 0) = "X"
max(8, 1) = 10
max(9, 0) = "IX"
max(9, 1) = 9
max(10, 0) = "V"
max(10, 1) = 5
max(11, 0) = "IV"
max(11, 1) = 4
max(12, 0) = "I"
max(12, 1) = 1
alma = TextBoxEntero.Text
For i = 0 To cont - 1
For j = 0 To cont - 1
If (alma >= 1000) Then
TextBoxRomano.Text += max(0, 0)
alma = alma - CInt(max(0, 1))

ElseIf (alma >= 900) Then


TextBoxRomano.Text += max(1, 0)
alma = alma - CInt(max(1, 1))
ElseIf (alma >= 500) Then
TextBoxRomano.Text += max(2, 0)
alma = alma - CInt(max(2, 1))
ElseIf (alma >= 400) Then
TextBoxRomano.Text += max(3, 0)
alma = alma - CInt(max(3, 1))
ElseIf (alma >= 100) Then
TextBoxRomano.Text += max(4, 0)
alma = alma - CInt(max(4, 1))
ElseIf (alma >= 90) Then
TextBoxRomano.Text += max(5, 0)
alma = alma - CInt(max(5, 1))
ElseIf (alma >= 50) Then
TextBoxRomano.Text += max(6, 0)
alma = alma - CInt(max(6, 1))
ElseIf (alma >= 40) Then
TextBoxRomano.Text += max(7, 0)
alma = alma - CInt(max(7, 1))
ElseIf (alma >= 10) Then
TextBoxRomano.Text += max(8, 0)
alma = alma - CInt(max(8, 1))
ElseIf (alma >= 9) Then
TextBoxRomano.Text += max(9, 0)
alma = alma - CInt(max(9, 1))
ElseIf (alma >= 5) Then
TextBoxRomano.Text += max(10, 0)

alma = alma - CInt(max(10, 1))


ElseIf (alma >= 4) Then
TextBoxRomano.Text += max(11, 0)
alma = alma - CInt(max(11, 1))
ElseIf (alma >= 1) Then
TextBoxRomano.Text += max(12, 0)
alma = alma - CInt(max(12, 1))
End If
Next
Next
End Sub
Private Sub Borrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Borrar.Click
TextBoxRomano.Text = ""
TextBoxEntero.Text = ""
TextBoxEntero.Focus()
End Sub

Public Class lblSubTotal


Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim SubTotal As Double
Dim IGV As Double
Dim Total As Double
SubTotal = (txtcantidad.Text) * CDbl(txtCU.Text)
txtSubTotal.Text = SubTotal
IGV = SubTotal * 0.18
txtIGV.Text = IGV
Total = SubTotal + IGV
txtTotal.Text = Total
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
txtcantidad.Text = ""
txtCU.Text = ""
txtIGV.Text = ""
txtproducto.Text = ""
txtSubTotal.Text = ""
txtTotal.Text = ""
txtCU.Text = ""
txtproducto.Focus()
End Sub
End Class

You might also like