Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Diagnose {
- String diagS;
- String diagA;
- int laborU ;
- int operations;
- String [] mediList;
- //Konstruktor
- public Diagnose( String diagS, String diagA, int laborU, int operations)
- {
- this.diagS = diagS;
- this.diagA = diagA;
- this.laborU = laborU;
- this.operations = operations;
- this.mediList = new String[20];
- }
- //Getter
- String getDiags(){ return diagS; }
- String getDiagA(){ return diagA; }
- int getLaborU(){ return laborU; }
- int getOperations(){ return operations; }
- String [] getMediList(){ return mediList;}
- /*
- * fügt ein neues Medikament zur Liste der Medikamente hinzu
- */
- public void neuesMedikament(String medi)
- {
- int counter = 0;
- if(counter < mediList.length && medi == null) return;
- while(counter < mediList.length && mediList[counter]!= null)
- {
- counter++;
- }
- if(counter >= mediList.length ) return;
- mediList[counter]= medi;
- }
- /*
- * gibt Infos der Diagnose aus
- */
- public void ausgabe()
- {
- System.out.println(" Diagnoseschluessel: "+diagS);
- System.out.println(" Diagnosearzt: "+diagA);
- System.out.println(" Laboruntersuchungen: "+laborU);
- System.out.println(" Chirurgische Eingriffe: "+operations);
- System.out.println(" +------------------------+");
- System.out.println(" | Medikamente |");
- System.out.println(" +------------------------+");
- for(int i = 0; i< mediList.length; i++)
- if(mediList[i]!=null)
- System.out.println(" "+mediList[i]);
- }
- }
Add Comment
Please, Sign In to add comment