Está en la página 1de 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace factura
{
class Program
{
static void Main(string[] args)
{
string nombre, producto, op = "";
double cant, cost, sub_total, iva, total, descuento, total_de_descue
nto, total_mas_des;
Console.WriteLine("ingrese el nombre del cliente");
nombre = Convert.ToString(Console.ReadLine());
Console.WriteLine("\n ingrese el nomre del producto");
producto = Convert.ToString(Console.ReadLine());
Console.WriteLine("\n ingrese la cantidad");
cant = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("\n ingrese el costo");
cost = Convert.ToDouble(Console.ReadLine());
sub_total = cant * cost;
Console.WriteLine("\n tiene descuento");
op = Convert.ToString(Console.ReadLine());
if (op == "si")
{
Console.WriteLine("ingrese la cantidad de descuento");
descuento = Convert.ToDouble(Console.ReadLine());
total_de_descuento = sub_total * descuento;
total_mas_des = sub_total - total_de_descuento;
Console.WriteLine("el descuento es {0}", total_de_descuento);
}
else
{
total_mas_des = sub_total;
}
iva = 0.12 * total_mas_des;
total = total_mas_des + iva;
Console.WriteLine("\n el sub_total es {0}", total_mas_des);
Console.WriteLine("\n el iva es {0}", iva);
Console.WriteLine("\n el total es {0}", total);
Console.ReadLine();

}
}
}

También podría gustarte