Está en la página 1de 1

HERRAMIENTAS DE DESARROLLO DE SOFTWARE COMPUTACION E INFORMATICA

DISEÑAR LA SIGUIENTE APLICACIÓN EN VISUAL BASIC NET Código Fuente del btncalcular

Problema: Descuento Private Sub btncalcular_Click(sender As Object, e As EventArgs) Handles btncalcular.Click


'Declaración de variables
Diseñar una aplicación que permita ingresar el Diagrama de Flujo Dim cant As Integer
precio unitario de un producto vendido y la cantidad Dim punitario As Single, pparcial As Single
de venta; después calcular el precio parcial (precio Dim desc As Single, pneto As Single
unitario * cantidad), mostrar un descuento del 7% Dim marcadodesc As Boolean
sólo si el vendedor ha seleccionado la opción de 'Inicializamos el descuento en
aplicar descuento, al final mostrar también el precio desc = 0
neto (precio parcial – descuento). 'Entrada de datos
cant = Val(txtcant.Text)
Formulario
punitario = Val(txtpunitario.Text)
marcadodesc = chkdescuento.Checked
'Proceso
pparcial = cant * punitario
'Evaluamos si tiene o no descuento
If marcadodesc = True Then
desc = pparcial * 0.07
End If
pneto = pparcial - desc

'Salida de Información
txtpparcial.Text = pparcial
txtdesc.Text = desc
txtpneto.Text = pneto
End Sub
Código Fuente del btnsalir
Private Sub btnsalir_Click(sender As Object, As EventArgs) Handles btnsalir.Click
If MessageBox.Show("Esta Seguro que desea salir", "SISTEMA", MessageBoxButtons.YesNo,
MessageBoxIcon.Information) = Windows.Forms.DialogResult.Yes Then
Application.Exit()
End If
End Sub
Código Fuente del btnnuevo
Private Sub btnnuevo_Click(sender As Object, e As EventArgs) Handles btnnuevo.Click
txtcant.Clear()
txtpunitario.Clear()
txtpparcial.Clear()
txtdesc.Clear()
txtpneto.Clear()
End Sub

También podría gustarte