Skip to content

Instantly share code, notes, and snippets.

@HugoRoca
Created October 21, 2022 04:16
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/3aecd2b176cd22af5d4993ba0439a644 to your computer and use it in GitHub Desktop.
Save HugoRoca/3aecd2b176cd22af5d4993ba0439a644 to your computer and use it in GitHub Desktop.
if (anios <= 0) Console.WriteLine("Los datos son incorrectos.");
else
{
if (anios <= 2)
{
if (rol == "A")
{
salary = 2000;
}
else if (rol == "C")
{
salary = 1500;
}
else if (rol == "S")
{
salary = 1000;
}
}
else if (anios >= 3 && anios <= 5)
{
if (rol == "A")
{
salary = 2500;
}
else if (rol == "C")
{
salary = 2000;
}
else if (rol == "S")
{
salary = 1500;
}
}
else if (anios >= 6 && anios <= 8)
{
if (rol == "A")
{
salary = 3000;
}
else if (rol == "C")
{
salary = 2500;
}
else if (rol == "S")
{
salary = 2000;
}
}
else
{
if (rol == "A")
{
salary = 4000;
}
else if (rol == "C")
{
salary = 3500;
}
else if (rol == "S")
{
salary = 2500;
}
}
Console.WriteLine("Tu sueldo es de: S/ {0}", salary);
}
Console.ReadKey()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment