Skip to content

Instantly share code, notes, and snippets.

@HugoRoca
Created October 31, 2022 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HugoRoca/5deac377c66f4538c993b9944a02e12e to your computer and use it in GitHub Desktop.
Save HugoRoca/5deac377c66f4538c993b9944a02e12e to your computer and use it in GitHub Desktop.
Console.WriteLine("\n\nExercise 4:");
Console.Write("Ingrese el precio por unidad de cada producto: ");
double productPrice = double.Parse(Console.ReadLine());
Console.Write("Ingrese la cantidad adquirida por el cliente: ");
int quantity = Int32.Parse(Console.ReadLine());
double totalPay04 = productPrice * quantity;
if (quantity > 20) totalPay04 -= (totalPay04 * 0.1);
else if (quantity > 10) totalPay04 -= (totalPay04 * 0.05);
Console.WriteLine("El cliente debe pagar S/ {0} por {1} articulos.", totalPay04, quantity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment