lunes, 26 de enero de 2009

Implementacion clase VentasTotalesMiniSuper

using System;
using System.Collections.Generic;
using System.Text;

namespace Aplicacion_de_Ventas_Semanal
{
class VentasTotalesMiniSuper
{
double[] VentasTotales;
int i,mayIndice,menIndice;
double mayorVenta, menorVenta;

public VentasTotalesMiniSuper()
{
VentasTotales = new double[7];
}
public void asignarDato(int j, double dato)
{
VentasTotales[j]= dato;
}
public double obtenerDato(int j)
{
return VentasTotales[j];
}
public int ventaMayor()
{
mayorVenta = VentasTotales[0];
mayIndice = 0;
for (i = 1; i < 7; i = i + 1)
{
if (VentasTotales[i] > mayorVenta)
{
mayorVenta = VentasTotales[i];
mayIndice = i;
}
}
return mayIndice;
}
public int ventaMenor()
{
menorVenta = VentasTotales[0];
menIndice = 0;
for (i = 1; i < 7; i++)
{
if (VentasTotales[i] < menorVenta)
{
menorVenta = VentasTotales[i];
menIndice = i;
}
}
return menIndice;
}
public double intervalo()
{
return mayorVenta - menorVenta;
}


}
}

No hay comentarios: