You are on page 1of 2

Imports Microsoft.

VisualBasic
Imports System.Console
'*******EJEMPLO******
'Public Class Bicicleta
'
Public Modelo As String
'
Public Precio As Double
'
Public NumeroDeVelocidades As Integer
'
Private Velocidad As Integer
'
'
'

Public Sub Acelerar(ByVal km As Integer)


Velocidad = Velocidad + km
End Sub

'
'
'
'
'

Public Sub Frenar()


If Velocidad > 0 Then
Velocidad = Velocidad - 1
End If
End Sub

'
Public Function ConsutarVelocidad() As Integer
'
Return Velocidad
'
End Function
'End Class

Public Class xyz


Dim ant, act As Double
Public Shared Sub main()
Dim ant, act As Double
Dim resp As String
Dim des As String
Dim inflacion, tot1, tot2 As Double
Do
WriteLine("Compaia XYZ: ")
WriteLine(vbCrLf & "descripcion del articulo: ")
des = ReadLine()
Do
WriteLine(vbCrLf & "Precio anterior: ")
ant = ReadLine()
ant = ant
tot1 = ant + tot1
Loop While (ant < 0)
Do
WriteLine(vbCrLf & "Precio actual: ")
act = ReadLine()
act = act
tot2 = act + tot2
Loop While (act < 0)
inflacion = calcular_inflacion(ant, act)

WriteLine(vbCrLf & "Descripcion del artciculo: {0}" & vbCrLf & "Prec
io anterior del articulo: {1}$" & vbCrLf & "Precio actual del articulo: {2}$" &
vbCrLf & "porcentaje de inflacion: {3}%", des, ant, act, inflacion.ToString("#,#
#0.00"))
WriteLine(vbCrLf & "Precio anterior total: {0}", tot1)
Console.WriteLine(vbCrLf & "Precio actual total: {0}", tot2)
WriteLine(vbCrLf & vbCrLf & "Desea introducir otro cliente? S/N")
resp = Console.ReadLine()
Clear()
Loop While (resp = "s" Or resp = "S")

End Sub
Public Function calcular_inflacion(ByVal act1 As Double, ByVal ant1 As Doubl
e) As Double
Dim infla As Double
infla = (((act - ant) / ant) * 100)
Return infla
End Function
End Class

You might also like