Advertisement
reymisterio

ejemplo 6

Feb 28th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static int horasTrabajadas, horasExtras, pagoTotal, pagoExtra, pagoEnTotal;
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Inserte el numero de horas trabajadas");
  14.             horasTrabajadas = int.Parse(Console.ReadLine());
  15.             if (horasTrabajadas > 0)
  16.             {
  17.                 consultarHoras(horasTrabajadas);
  18.             }
  19.         }
  20.         static void consultarHoras(int horas)
  21.         {
  22.             if (horas <= 40)
  23.             {
  24.                 pagoTotal = horas * 27;
  25.                 Console.WriteLine("Horas totales: " + horas + "\n Tu pago es de: " + pagoTotal);
  26.                 Console.Read();
  27.             }
  28.             else if (horas > 40)
  29.             {
  30.                 horasExtras = horas - 40;
  31.                 pagoExtra = horasExtras * 30;
  32.                 pagoTotal = (horas - horasExtras) * 27;
  33.                 pagoEnTotal = pagoExtra + pagoTotal;
  34.                 Console.WriteLine("Horas trabajadas: "+ horas +"\n Horas extras: "+ horasExtras+ "\n Pago por horas: "+ pagoTotal + "\n Pagos extra: "+ pagoExtra + "\n Pago total: " + pagoEnTotal);
  35.                 Console.Read();
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement