Initial sharing of project
						commit
						85cc36c3c8
					
				|  | @ -0,0 +1,30 @@ | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Beschreiben Sie hier die Klasse Datenbank. | ||||||
|  |  *  | ||||||
|  |  * @author (Ihr Name)  | ||||||
|  |  * @version (eine Versionsnummer oder ein Datum) | ||||||
|  |  */ | ||||||
|  | public class Datenbank | ||||||
|  | { | ||||||
|  |     //Attribute
 | ||||||
|  |     private Student[] Studenten; | ||||||
|  |     private int Anzahl = 0; | ||||||
|  |     public Datenbank(int max){ | ||||||
|  |      Studenten = new Student [max];    | ||||||
|  |     } | ||||||
|  |     //Konstruktor
 | ||||||
|  |     public String toString(){ | ||||||
|  |     String result = ""; | ||||||
|  |     for(int i = 0; i<Anzahl; i++){ | ||||||
|  |     result = result + Studenten[i].toString(); | ||||||
|  |     result +=  "\n"; | ||||||
|  |     } | ||||||
|  |     return result; | ||||||
|  |     } | ||||||
|  |     public void addStudent(Student s){ | ||||||
|  |     Studenten[Anzahl] = s; | ||||||
|  |     Anzahl++; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  | } | ||||||
|  | @ -0,0 +1,14 @@ | ||||||
|  | ------------------------------------------------------------------------ | ||||||
|  | Dies ist die README-Datei des Projekts. Hier sollten Sie Ihr Projekt | ||||||
|  | beschreiben. | ||||||
|  | Erzählen Sie dem Leser (jemand, der nichts über dieses Projekt weiss), | ||||||
|  | alles, was er/sie wissen muss. Üblicherweise sollte der Kommentar  | ||||||
|  | zumindest die folgenden Angaben umfassen: | ||||||
|  | ------------------------------------------------------------------------ | ||||||
|  | 
 | ||||||
|  | PROJEKTBEZEICHNUNG: | ||||||
|  | PROJEKTZWECK: | ||||||
|  | VERSION oder DATUM: | ||||||
|  | WIE IST DAS PROJEKT ZU STARTEN: | ||||||
|  | AUTOR(EN): | ||||||
|  | BENUTZERHINWEISE: | ||||||
|  | @ -0,0 +1,25 @@ | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Beschreiben Sie hier die Klasse Student. | ||||||
|  |  *  | ||||||
|  |  * @author (Ihr Name)  | ||||||
|  |  * @version (eine Versionsnummer oder ein Datum) | ||||||
|  |  */ | ||||||
|  | public class Student | ||||||
|  | { | ||||||
|  |     //Attribute
 | ||||||
|  |     private String Name; | ||||||
|  |     private int Matrikelnummer; | ||||||
|  |     private String Studiengang; | ||||||
|  |     //Konstruktor
 | ||||||
|  |     public Student (String n, int m, String g){ | ||||||
|  |     Name = n; | ||||||
|  |     Matrikelnummer = m; | ||||||
|  |     Studiengang = g; | ||||||
|  |      | ||||||
|  |     } | ||||||
|  |     //Methoden
 | ||||||
|  |     public String toString(){ | ||||||
|  |     return Name + " ("+ Matrikelnummer + ") " + " studiert " +Studiengang; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,19 @@ | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Beschreiben Sie hier die Klasse StudentTest. | ||||||
|  |  *  | ||||||
|  |  * @author (Ihr Name)  | ||||||
|  |  * @version (eine Versionsnummer oder ein Datum) | ||||||
|  |  */ | ||||||
|  | public class StudentTest | ||||||
|  | { | ||||||
|  |      | ||||||
|  |    public static void test(int max){ | ||||||
|  |     Datenbank db = new Datenbank(max); | ||||||
|  |      | ||||||
|  |       | ||||||
|  |     db.addStudent(new Student("Klaus",24658,"Kunst"));  | ||||||
|  |     System.out.println(db); | ||||||
|  |    } | ||||||
|  |     | ||||||
|  | } | ||||||
|  | @ -0,0 +1,55 @@ | ||||||
|  | #BlueJ package file | ||||||
|  | dependency1.from=Datenbank | ||||||
|  | dependency1.to=Student | ||||||
|  | dependency1.type=UsesDependency | ||||||
|  | dependency2.from=StudentTest | ||||||
|  | dependency2.to=Datenbank | ||||||
|  | dependency2.type=UsesDependency | ||||||
|  | dependency3.from=StudentTest | ||||||
|  | dependency3.to=Student | ||||||
|  | dependency3.type=UsesDependency | ||||||
|  | editor.fx.0.height=728 | ||||||
|  | editor.fx.0.width=800 | ||||||
|  | editor.fx.0.x=1016 | ||||||
|  | editor.fx.0.y=184 | ||||||
|  | objectbench.height=66 | ||||||
|  | objectbench.width=776 | ||||||
|  | package.divider.horizontal=0.6 | ||||||
|  | package.divider.vertical=0.8528225806451613 | ||||||
|  | package.editor.height=416 | ||||||
|  | package.editor.width=661 | ||||||
|  | package.editor.x=40 | ||||||
|  | package.editor.y=85 | ||||||
|  | package.frame.height=560 | ||||||
|  | package.frame.width=800 | ||||||
|  | package.numDependencies=3 | ||||||
|  | package.numTargets=3 | ||||||
|  | package.showExtends=true | ||||||
|  | package.showUses=true | ||||||
|  | project.charset=UTF-8 | ||||||
|  | readme.height=60 | ||||||
|  | readme.name=@README | ||||||
|  | readme.width=48 | ||||||
|  | readme.x=10 | ||||||
|  | readme.y=10 | ||||||
|  | target1.height=70 | ||||||
|  | target1.name=StudentTest | ||||||
|  | target1.showInterface=false | ||||||
|  | target1.type=ClassTarget | ||||||
|  | target1.width=120 | ||||||
|  | target1.x=120 | ||||||
|  | target1.y=160 | ||||||
|  | target2.height=70 | ||||||
|  | target2.name=Datenbank | ||||||
|  | target2.showInterface=false | ||||||
|  | target2.type=ClassTarget | ||||||
|  | target2.width=120 | ||||||
|  | target2.x=270 | ||||||
|  | target2.y=30 | ||||||
|  | target3.height=70 | ||||||
|  | target3.name=Student | ||||||
|  | target3.showInterface=false | ||||||
|  | target3.type=ClassTarget | ||||||
|  | target3.width=120 | ||||||
|  | target3.x=70 | ||||||
|  | target3.y=10 | ||||||
		Loading…
	
		Reference in New Issue