lunes, 28 de septiembre de 2009

Practica 3.3 Consola




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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double cantidad, codigo, precio,total,pago,descuento;
Console.WriteLine("Introduce el codigo del articulo:");
codigo = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el precio unitareo del articulo:");
precio = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad del articulo:");
cantidad = double.Parse(Console.ReadLine());
if (cantidad > 100)
{
Console.WriteLine("descuento 40%");
total = cantidad * precio;
descuento = total + 0.40;
pago = total - descuento;
}
else

{

if(cantidad>=25 && cantidad<=100)
{ Console.WriteLine("descuento 20%");
total = cantidad * precio;
descuento = total * 0.20;
pago = total - descuento;
}
else
{
if(cantidad>=10 && cantidad<=24)
{
Console.WriteLine("descuento 10%");
total = cantidad * precio;
descuento = total * 0.10;
pago = total - descuento;

}
else
{
Console.WriteLine("no hay descuento");
total=cantidad*precio;
descuento=0;
pago=total-descuento;
}
}
}
Console.WriteLine("total = {0} descuento={1} pago={2}",precio,pago);

Console.ReadKey();

}
}
}

No hay comentarios:

Publicar un comentario