Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SumaProductoNumeros
- {
- class Program
- {
- static void Main(string[] args)
- {
- int producto, cantidad;
- double desc, total, totalapagar;
- string linea;
- Console.Write("Ingrese el precio del producto: ");
- linea = Console.ReadLine();
- producto = int.Parse(linea);
- Console.Write("Ingrese la cantidad de productos: ");
- linea = Console.ReadLine();
- cantidad = int.Parse(linea);
- total = producto * cantidad;
- if (total>5000)
- {
- desc = total * 0.05;
- totalapagar = total - desc;
- Console.Write("5% de descuento de la compra: ");
- Console.WriteLine(desc);
- Console.Write("El total a pagar es: ");
- Console.WriteLine(totalapagar);
- Console.ReadKey();
- }
- else
- {
- desc = total * 0.02;
- totalapagar = total - desc;
- Console.Write("2% de descuento de la compra: ");
- Console.WriteLine(desc);
- Console.Write("El total a pagar es: ");
- Console.WriteLine(totalapagar);
- Console.ReadKey();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement