Advertisement
Ecchijpbp

Programación 3-1

Apr 17th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. //MEDICO.CS
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Medicos
  9. {
  10. class Medico
  11. {
  12. int matricula;
  13. string nombre;
  14. bool sexo;
  15. DateTime fecha;
  16. int especialidad;
  17. double montoConsulta;
  18. public int pMatricula { set { matricula = value; } get { return matricula; } }
  19. public string pNombre { set { nombre = value; } get { return nombre; } }
  20. public bool pSexo { set { sexo = value; } get { return sexo; } }
  21. public DateTime pFecha { set { fecha = value;} get{return fecha;} }
  22. public int pEspecialidad { set { especialidad = value; } get { return especialidad; } }
  23. public double pmontoConsulta { set { montoConsulta = value; } get { return especialidad; } }
  24.  
  25. public Medico()
  26. {
  27. matricula = 0;
  28. nombre = "";
  29. sexo = true;
  30. fecha = DateTime.Today;
  31. especialidad = 0;
  32. montoConsulta = 0;
  33. }
  34. public string SexToString()
  35. {
  36. if (sexo)
  37. return "Masculino";
  38. else
  39. return "Femenino";
  40. }
  41. public string toStringEspecialidad()
  42. {
  43. if (especialidad == 1)
  44. {
  45. return "Cardiologia";
  46. }
  47. else if (especialidad == 2)
  48. {
  49. return "Odontologia";
  50. }
  51. else if (especialidad == 3)
  52. {
  53. return "Pediatria";
  54. }
  55. else
  56. {
  57. return "Nulo";
  58.  
  59. }
  60. }
  61.  
  62. public string toString()
  63. {
  64.  
  65. return "Matricula: " + matricula + "\n" + "Nombre: " + nombre + "\n" + "Sexo: " + SexToString() + "\n" + "Fecha: " + fecha + "\n" + "Especialidad: " + toStringEspecialidad() + "\n" + "Monto de Consulta: " + montoConsulta;
  66.  
  67.  
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement