Advertisement
Primitiv0

Invoice

Sep 10th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SumaProductoNumeros
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int producto, cantidad;
  14.             double desc, total, totalapagar;
  15.             string linea;
  16.             Console.Write("Ingrese el precio del producto: ");
  17.             linea = Console.ReadLine();
  18.             producto = int.Parse(linea);
  19.             Console.Write("Ingrese la cantidad de productos: ");
  20.             linea = Console.ReadLine();
  21.             cantidad = int.Parse(linea);
  22.             total = producto * cantidad;
  23.             if (total>5000)
  24.             {
  25.               desc = total * 0.05;
  26.               totalapagar = total - desc;
  27.               Console.Write("5% de descuento de la compra: ");
  28.               Console.WriteLine(desc);
  29.               Console.Write("El total a pagar es: ");
  30.               Console.WriteLine(totalapagar);
  31.               Console.ReadKey();
  32.             }
  33.             else
  34.             {
  35.               desc = total * 0.02;
  36.               totalapagar = total - desc;
  37.               Console.Write("2% de descuento de la compra: ");
  38.               Console.WriteLine(desc);
  39.               Console.Write("El total a pagar es: ");
  40.               Console.WriteLine(totalapagar);
  41.               Console.ReadKey();
  42.             }
  43.             Console.ReadKey();
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement