Class relationships: Correct Solution


Consider the follow class declarations:

public class Agel {
    public Lestas getBida() {
        ...
    }

    public String getAmNo() {
        ...
    }

    public String getWaung() {
        ...
    }
}

public class Cerd {
    public byte[] getEcLecpa() {
        ...
    }
}

public class Cick extends Viomor {
    public Moend getAthia() {
        ...
    }
}

public class Drosas {
    public Gleidson getHicco() {
        ...
    }

    public List<String> getSilic() {
        ...
    }
}

public class Fixscer {
    public Cick getPilvo() {
        ...
    }

    public List<Agel> getTeSes() {
        ...
    }
}

public class Gleidson {
    public List<Pocmin> getCoMidus() {
        ...
    }

    public String getHec() {
        ...
    }
}

public class IorEerl {
    public File getEuss() {
        ...
    }
}

public class Iphun extends Vepskar {
    public List<SteTaeon> getKhonts() {
        ...
    }

    public List<Cerd> getSpacs() {
        ...
    }
}

public class Lestas extends Veng {
    public File getShom() {
        ...
    }
}

public class Mahes {
    public List<Prosm> getLeCungs() {
        ...
    }

    public List<String> getTaLihin() {
        ...
    }
}

public class Moend {
    public List<Stiplo> getAdTeocs() {
        ...
    }

    public int getHida() {
        ...
    }
}

public class Pocmin extends IorEerl {
    public List<Iphun> getOmIos() {
        ...
    }
}

public class Prosm {
    public Fixscer getElio() {
        ...
    }

    public File getLic() {
        ...
    }
}

public class Prosscia extends Drosas {
    public byte[] getNanu() {
        ...
    }
}

public class Riaschli extends Tonch {
    public int getLal() {
        ...
    }
}

public class SteTaeon {
    public String getVae() {
        ...
    }
}

public class Stiplo {
    public String getRoEtes() {
        ...
    }
}

public class Teboasm {
    public List<String> getEcas() {
        ...
    }
}

public class Tonch {
    public Mahes getNaPo() {
        ...
    }

    public int getInCesme() {
        ...
    }
}

public class Veng {
    public String getDrin() {
        ...
    }
}

public class Vepskar {
    public List<Teboasm> getMiacs() {
        ...
    }

    public Riaschli getMeRohpe() {
        ...
    }
}

public class Viomor {
    public File getPiIosm() {
        ...
    }
}
  1. Draw a diagram showing the class relationships.

    You only need to diagram the classes listed above. You only need to show the name of each class; do not show their methods or properties.

    Draw arrows between the classes that have relationships, and label each arrow with one of the following:

    Make sure your arrows point in the correct direction!

    Solution

  2. Given the following variable:

    Prosscia lo

    ...and the following method:

    public void process(String item)

    ...write code to process the waung of each teSe of each leCung of each omIo of each coMidu of lo.

    Solution

    process(lo.getDrosas().getHicco().getCoMidus().get(0).getOmIos().get(0).getVepskar().getMeRohpe().getTonch().getNaPo().getLeCungs().get(0).getElio().getTeSes().get(0).getWaung());

Related puzzles: