using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Venta_de_15_productos
{
class VentasProductos
{
double[] pedidos;
int[] inventario;
int[] codigo;
string[] nombreProd;
double[] preciosProd;
int[] ventaTotalProd;
int[] ventaTotalProd1;
int i, NoPedidos;
double promedio;
public VentasProductos()
{
inventario = new int[15] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
codigo = new int[15] { 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14 };
nombreProd = new string[15] { "xbox", "xbox 360", "play Station 3", "Pay Station 2", "Nintendo Wii", "Nintendo 64", "Mario Kart 64", "LapTopHp", "WOW III", "LapTopDell", "Super Smash Bros.", "super Smash Bros. Brawl", "Lap Top Hp", "Lap Top Dell", "God of War" };
preciosProd = new double[15] { 1500.00, 3250.70, 8899.95, 1750.64, 4950.45, 789.99, 320.00, 220.99, 320.50, 1199.99, 459.99, 789.98, 1499.90, 1789.95, 1200.43 };
ventaTotalProd = new int[15];
ventaTotalProd1 = new int[15];
pedidos = new double[15];
i = NoPedidos = 0;
}
public double mostrarpreciopedidos(int k)
{
return pedidos[k];
}
public void asignarpedidodinero(int k, double l)
{
pedidos[k] = pedidos[k] + l;
}
public string obtenerNombreProd(int j)
{
return nombreProd[j];
}
public int obtenerCodigo(int j)
{
return codigo[j];
}
public double obtenerPreciosProd(int j)
{
return preciosProd[j];
}
public void asignarVentaTotalProd(int j, int dato)
{
ventaTotalProd[j] = ventaTotalProd[j] + dato;
ventaTotalProd1[j] = ventaTotalProd1[j] + dato;
}
public void incrementaPedido()
{
NoPedidos++;
}
public int obtenerPedido()
{
return NoPedidos;
}
public double precioTotal(int k)
{
double precio;
precio = ventaTotalProd1[k] * preciosProd[k];
return precio;
}
public void cero(int k)
{
ventaTotalProd1[k] = 0;
}
public double ventaTotalPedidos()
{
double suma = 0.0;
for (i = 0; i < suma =" suma" total =" inventario[j];" suma =" 0.0;" i =" 0;" suma =" suma" promedio =" (suma" mayproduct =" ventaTotalProd[0];" mayindice =" 0;" i =" 1;"> mayproduct)
{
mayproduct = ventaTotalProd[i];
mayIndice = i;
}
}
nombre = nombreProd[mayIndice];
return nombre;
}
public string productoMenosVendido()
{
string nombre;
double mayproduct;
int mayIndice;
mayproduct = ventaTotalProd[0];
mayIndice = 0;
for (i = 1; i < mayproduct =" ventaTotalProd[i];" mayindice =" i;" nombre =" nombreProd[mayIndice];" desviacion =" ventaTotalProd[k]" mayproduct =" pedidos[0];" mayindice =" 0;" i =" 1;"> mayproduct)
{
mayproduct = pedidos[i];
mayIndice = i;
}
}
return mayIndice + 1;
}
}
}
No hay comentarios:
Publicar un comentario