// UEBUNG 10 AUFGABE 4 import gdi.util.*; public class u10a1d { public static void main(String[] args) { Reise_3 reise = new Reise_3(); while(true) { ReiseStation_3 station = new ReiseStation_3(); Out.print("Name: "); station.name = In.readWord(); if (!In.done()) break; Out.print("Kommentar: "); station.kommentar = In.readString(); station.datum = new Datum(); Out.print("Tag: "); station.datum.tag = In.readInt(); Out.print("Monat: "); station.datum.monat = In.readInt(); Out.print("Jahr: "); station.datum.jahr = In.readInt(); if (reise.ersteStation == null) { reise.ersteStation = station; reise.letzteStation = station; } else { reise.letzteStation.naechsteStation = station; reise.letzteStation = station; } } Out.println("Die Reise:"); ReiseStation_3 x = reise.ersteStation; while(x != null) { Out.println("Station: " + x.name + ", Kommentar: " + x.kommentar + " Datum: " + x.datum.tag + "." + x.datum.monat + "." + x.datum.jahr); x = x.naechsteStation; } } }