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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static int horasTrabajadas, horasExtras, pagoTotal, pagoExtra, pagoEnTotal;
- static void Main(string[] args)
- {
- Console.WriteLine("Inserte el numero de horas trabajadas");
- horasTrabajadas = int.Parse(Console.ReadLine());
- if (horasTrabajadas > 0)
- {
- consultarHoras(horasTrabajadas);
- }
- }
- static void consultarHoras(int horas)
- {
- if (horas <= 40)
- {
- pagoTotal = horas * 27;
- Console.WriteLine("Horas totales: " + horas + "\n Tu pago es de: " + pagoTotal);
- Console.Read();
- }
- else if (horas > 40)
- {
- horasExtras = horas - 40;
- pagoExtra = horasExtras * 30;
- pagoTotal = (horas - horasExtras) * 27;
- pagoEnTotal = pagoExtra + pagoTotal;
- Console.WriteLine("Horas trabajadas: "+ horas +"\n Horas extras: "+ horasExtras+ "\n Pago por horas: "+ pagoTotal + "\n Pagos extra: "+ pagoExtra + "\n Pago total: " + pagoEnTotal);
- Console.Read();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement