You are on page 1of 6

HERRAMIENTA DE DESARROLLO DE SOFTWARE

DESARROLLO DE PRACTICA DE LABORATORIO

Diseo:
ComboBox1:
Name: cmbProducto
Items: Refrigeradora/Lavadora/Equipo de Sonido/
Televisor 3D/ Cocina
TextBox1:
Name: txtPrecio
TextBox2:
Name: txtCuotaIni
TextBox3:
Name: txtNroCuota
TextBox4:
Name: txtMonCuota
Button1:
Name: btnCalcular
Text : Calcular

clsVentaCredito
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;

namespace Laboratorio01_01
{
class clsVentaCredito
{
public double precio;
public int nroCuotas;
public double cuotaInicial;
public double montoCuota;
private double obtenerMontoCredito(){
return (this.precio - this.cuotaInicial);
}
private double obtenerInteres()
{
double interes=0;
if (this.nroCuotas >= 0 && this.nroCuotas <= 6)
interes = 0.10;
if (this.nroCuotas >= 7 && this.nroCuotas <= 12)
interes = 0.20;
if (this.nroCuotas >= 13)
interes = 0.30;
return interes;

Docente: William Pereda Pinazo

HERRAMIENTA DE DESARROLLO DE SOFTWARE


DESARROLLO DE PRACTICA DE LABORATORIO
}
public void calcularMontoCuota()
{
double montoInteres,totalCredito;
montoInteres=obtenerMontoCredito()*obtenerInteres();
totalCredito = obtenerMontoCredito() + montoInteres;
this.montoCuota = totalCredito / this.nroCuotas;
}
}
}

Formulario
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;

namespace Laboratorio01_01
{
public partial class Form1 : Form
{
clsVentaCredito objVentas = new clsVentaCredito();
public Form1()
{
InitializeComponent();
}

private void cmbProducto_SelectedIndexChanged(object sender, EventArgs e)


{
switch (cmbProducto.SelectedIndex)
{
case 0:
{
txtPrecio.Text = "1200";
break;
}
case 1:
{
txtPrecio.Text = "1500";
break;
}
case 2:
{

Docente: William Pereda Pinazo

HERRAMIENTA DE DESARROLLO DE SOFTWARE


DESARROLLO DE PRACTICA DE LABORATORIO
txtPrecio.Text
= "1350";
break;
}
case 3:
{
txtPrecio.Text
= "1500";
break;
}
case 4:
{
txtPrecio.Text
= "1100";
break;
}
}
}
private void btnCalcular_Click(object sender, EventArgs e)
{
objVentas.precio = double.Parse(txtPrecio.Text);
objVentas.cuotaInicial = double.Parse(txtCuotaIni.Text);
objVentas.nroCuotas = int.Parse(txtNroCuota.Text);
objVentas.calcularMontoCuota();
txtMonCuota.Text = objVentas.montoCuota.ToString();
}
}
}

Diseo:
ComboBox1:
Name: cmbCargo
Items: Gerente/Administrador/Contador/Secretaria/
Empleado
TextBox1:
Name: txtSueldo
TextBox2:
Name: txtHijos
Button1:
Name: btnGenerar
Text : Generar Planilla

Docente: William Pereda Pinazo

HERRAMIENTA DE DESARROLLO DE SOFTWARE


DESARROLLO DE PRACTICA DE LABORATORIO

ClsPlanilla
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;

namespace Laboratorio01_02
{
class clsPlanilla
{
public int nroHijo;
public int sueldo;
public string generarPlanilla(int mes){
string elemento="";
int xsueldo;
xsueldo=this.sueldo+(this.nroHijo*15);
switch (mes)
{
case 1:
{
elemento = "Enero \t"+ xsueldo.ToString();
break;
}
case 2:
{
elemento = "Febrero \t" + xsueldo.ToString();
break;
}
case 3:
{
elemento = "Marzo \t" + xsueldo.ToString();
break;
}
case 4:
{
elemento = "Abril \t" + xsueldo.ToString();
break;
}
case 5:
{
elemento = "Mayo \t" + xsueldo.ToString();
break;
}
case 6:
{
elemento = "Junio \t" + xsueldo.ToString();
break;
}
case 7:

Docente: William Pereda Pinazo

HERRAMIENTA DE DESARROLLO DE SOFTWARE


DESARROLLO DE PRACTICA DE LABORATORIO
{
elemento = "Julio \t" + (xsueldo * 2).ToString();
break;
}
case 8:
{
elemento = "Agosto \t" + xsueldo.ToString();
break;
}
case 9:
{
elemento = "Setiembre \t" + xsueldo.ToString();
break;
}
case 10:
{
elemento = "Octubre \t" + xsueldo.ToString();
break;
}
case 11:
{
elemento = "Noviembre \t" + xsueldo.ToString();
break;
}
case 12:
{
elemento = "Diciembre \t" + (xsueldo * 2).ToString();
break;
}
}
return elemento;
}
}
}

Formulario
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;

namespace Laboratorio01_02
{
public partial class Form2 : Form
{

Docente: William Pereda Pinazo

HERRAMIENTA DE DESARROLLO DE SOFTWARE


DESARROLLO DE PRACTICA DE LABORATORIO
public Form2()
{
InitializeComponent();
}

private void cmbCargo_SelectedIndexChanged(object sender, EventArgs e)


{
switch (cmbCargo.SelectedIndex)
{
case 0:
{
txtSueldo.Text = "2500";
break;
}
case 1:
{
txtSueldo.Text = "2000";
break;
}
case 2:
{
txtSueldo.Text = "1800";
break;
}
case 3:
{
txtSueldo.Text = "1500";
break;
}
case 4:
{
txtSueldo.Text = "1100";
break;
}
}
}
private void btnGenerar_Click(object sender, EventArgs e)
{
clsPlanilla objPlanilla = new clsPlanilla();
objPlanilla.sueldo = int.Parse(txtSueldo.Text);
objPlanilla.nroHijo = int.Parse(txtHijos.Text);
for (int x = 1; x <= 12; x++)
{
lstPlanilla.Items.Add(objPlanilla.generarPlanilla(x));
}
}
}
}

Docente: William Pereda Pinazo

You might also like