Ecchijpbp

Programacion 8-2

May 13th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Proyecto_Empleados
  8. {
  9. class Bedeles : Empleados
  10. {
  11. int categoria;
  12.  
  13. public int pCategoria { get { return categoria; } set { categoria = value; } }
  14.  
  15. public Bedeles(int categoria,int legajo, string nombre, double sueldobasico):base(legajo,nombre,sueldobasico)
  16. {
  17. this.categoria = categoria;
  18. }
  19.  
  20. public string toStringBedeles()
  21. {
  22. return "Categoria: " + toStringCategoria() + "\n"
  23. + toStringEmpleado() + "\n"
  24. + "Sueldo: " + calcularSueldo() + "\n";
  25.  
  26. }
  27.  
  28. public string toStringCategoria()
  29. {
  30. switch (categoria)
  31. {
  32. case 1: return "Interin";
  33. case 2: return "Concursado";
  34. case 3: return "Otro";
  35. default: return "Pickea categoria";
  36. }
  37. }
  38.  
  39. public double calcularSueldo()
  40. {
  41. if (categoria == 1)
  42. return pSueldo * 1.05;
  43. else if (categoria == 2)
  44. return pSueldo * 1.10;
  45. else
  46. return pSueldo;
  47. }
  48.  
  49.  
  50. }
  51. }
Add Comment
Please, Sign In to add comment