Como um pedreiro calcula a quantidade de tijolos que ele vai usar numa parede???
Bem ele tem que fazer operações básicas como área da parede, etc.
Bem vamos criar algo no VB.Net, monte o form como na imagem abaixo:
No botão calcular vamos aos códigos:
Dim areapar, arealivre, areapor, areajan, areatij, qtdetij As Double
areapar = txtaltpar.Text * txtcompar.Text
areapor = txtaltpor.Text * txtcompor.Text
areajan = txtaltjan.Text * txtcomjan.Text
areatij = txtalttij.Text * txtcomtij.Text
lblareapar.Text = areapar
lblareapor.Text = areapor
lblareajan.Text = areajan
arealivre = areapar - areapor - areajan
lblareatij.Text = areatij
qtdetij = CType(arealivre, Double) / CType(areatij, Double)
qtdetij = FormatNumber(qtdetij, 2)
lblqtdetij.Text = qtdetij
lbllivre.Text = arealivre
Depois é só usar a conversão da função Ctype para exibir.
Nenhum comentário:
Postar um comentário