Tudo bem? Então... Fiz um programinha usando orientação a objetos que faz cálculos para você quanto que tem que cobrar por uma bicicleta. Eu espero que gostem.
Public Class bicicleta
Private _roda As Double
Private _selim As Double
Private _guidao As Double
Private _pedais As Double
Private _quadro As Double
Private _freios As Double
Private _correntes As Double
Private _engrenagem As Double
Public Property roda() As Double
Get
Return _roda
End Get
Set(ByVal value As Double)
_roda = value
End Set
End Property
Public Property selim() As Double
Get
Return _selim
End Get
Set(ByVal value As Double)
_selim = value
End Set
End Property
Public Property guidao() As Double
Get
Return _guidao
End Get
Set(ByVal value As Double)
_guidao = value
End Set
End Property
Public Property pedais() As Double
Get
Return _pedais
End Get
Set(ByVal value As Double)
_pedais = value
End Set
End Property
Public Property quadro() As Double
Get
Return _quadro
End Get
Set(ByVal value As Double)
_quadro = value
End Set
End Property
Public Property freios() As Double
Get
Return _freios
End Get
Set(ByVal value As Double)
_freios = value
End Set
End Property
Public Property correntes() As Double
Get
Return _correntes
End Get
Set(ByVal value As Double)
_correntes = value
End Set
End Property
Public Property engrenagem() As Double
Get
Return _engrenagem
End Get
Set(ByVal value As Double)
_engrenagem = value
End Set
End Property
Public Function custo() As Double
Return roda + selim + guidao + pedais + quadro + freios +
correntes + engrenagem
End Function
Public Function lucro() As Double
Return custo() / 2
End Function
Public Function preco_venda() As Double
Return custo() + lucro()
End Function
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As New bicicleta
b.roda = TextBox1.Text
b.selim = TextBox2.Text
b.guidao = TextBox3.Text
b.pedais = TextBox4.Text
b.quadro = TextBox5.Text
b.freios = TextBox6.Text
b.correntes = TextBox7.Text
b.engrenagem = TextBox8.Text
TextBox9.Text = b.custo
TextBox10.Text = b.lucro
TextBox11.Text = b.preco_venda
End Sub
End Class
0 comentários:
Postar um comentário