Guest User

Untitled

a guest
Apr 25th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. public class Diagnose {
  2.  
  3.  
  4. String diagS;
  5. String diagA;
  6. int laborU ;
  7. int operations;
  8. String [] mediList;
  9.  
  10. //Konstruktor
  11.  
  12.  
  13.  
  14.  
  15. public Diagnose( String diagS, String diagA, int laborU, int operations)
  16. {
  17. this.diagS = diagS;
  18. this.diagA = diagA;
  19. this.laborU = laborU;
  20. this.operations = operations;
  21. this.mediList = new String[20];
  22. }
  23.  
  24. //Getter
  25. String getDiags(){ return diagS; }
  26.  
  27. String getDiagA(){ return diagA; }
  28.  
  29. int getLaborU(){ return laborU; }
  30.  
  31. int getOperations(){ return operations; }
  32.  
  33. String [] getMediList(){ return mediList;}
  34.  
  35.  
  36. /*
  37. * fügt ein neues Medikament zur Liste der Medikamente hinzu
  38. */
  39. public void neuesMedikament(String medi)
  40. {
  41. int counter = 0;
  42. if(counter < mediList.length && medi == null) return;
  43. while(counter < mediList.length && mediList[counter]!= null)
  44. {
  45. counter++;
  46. }
  47. if(counter >= mediList.length ) return;
  48. mediList[counter]= medi;
  49. }
  50.  
  51. /*
  52. * gibt Infos der Diagnose aus
  53. */
  54. public void ausgabe()
  55. {
  56. System.out.println(" Diagnoseschluessel: "+diagS);
  57. System.out.println(" Diagnosearzt: "+diagA);
  58. System.out.println(" Laboruntersuchungen: "+laborU);
  59. System.out.println(" Chirurgische Eingriffe: "+operations);
  60. System.out.println(" +------------------------+");
  61. System.out.println(" | Medikamente |");
  62. System.out.println(" +------------------------+");
  63. for(int i = 0; i< mediList.length; i++)
  64. if(mediList[i]!=null)
  65. System.out.println(" "+mediList[i]);
  66. }
  67.  
  68.  
  69.  
  70. }
Add Comment
Please, Sign In to add comment