Class relationships: Correct Solution


Consider the follow class declarations:

public class Brefim {
    public int getZoBiss() {
        ...
    }
}

public class Cangeal {
    public byte[] getKaZebat() {
        ...
    }
}

public class Censa {
    public Crosseac getZucod() {
        ...
    }

    public int getDiar() {
        ...
    }
}

public class Clougroo {
    public String getRaEbez() {
        ...
    }
}

public class Crosseac extends Vuent {
    public Ovif getRarra() {
        ...
    }
}

public class Cutred {
    public byte[] getPamot() {
        ...
    }
}

public class Flebol {
    public List<Tasplea> getOrens() {
        ...
    }

    public Sitchpa getLelt() {
        ...
    }
}

public class Hito {
    public Sanksu getPutal() {
        ...
    }

    public Clougroo getOsHibe() {
        ...
    }
}

public class Jegwi extends Klon {
    public List<Sosmgoss> getDesms() {
        ...
    }

    public List<Whasar> getRePhols() {
        ...
    }
}

public class Klon {
    public File getPle() {
        ...
    }

    public String getEnt() {
        ...
    }
}

public class Mentiec extends Censa {
    public byte[] getFiMuc() {
        ...
    }
}

public class Mizos {
    public int getXee() {
        ...
    }
}

public class Ovif {
    public List<String> getLelsi() {
        ...
    }
}

public class Preoc extends Brefim {
    public Cangeal getPseas() {
        ...
    }

    public Jegwi getWhi() {
        ...
    }
}

public class Sanksu extends Preoc {
    public List<Trocpral> getNonbas() {
        ...
    }
}

public class Sitchpa extends Cutred {
    public List<Hito> getLupmis() {
        ...
    }

    public List<Mizos> getHiGis() {
        ...
    }
}

public class Sosmgoss {
    public int getPhe() {
        ...
    }
}

public class Surad {
    public List<Mentiec> getPtests() {
        ...
    }

    public File getTaer() {
        ...
    }
}

public class Tasplea {
    public List<String> getBrec() {
        ...
    }
}

public class Trocpral {
    public List<String> getCaUbin() {
        ...
    }
}

public class Vuent {
    public List<Flebol> getBrongs() {
        ...
    }

    public File getCirow() {
        ...
    }
}

public class Whasar {
    public String getIoStese() {
        ...
    }
}
  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:

    Surad ki

    ...and the following method:

    public void process(String item)

    ...write code to process the ent of each lupmi of each brong of the first ptest of ki.

    Solution

    for (Mentiec ptest : ki.getPtestsList()) {
        process(ptest.getCensa().getZucod().getVuent().getBrongs().get(0).getLelt().getLupmis().get(0).getPutal().getPreoc().getWhi().getKlon().getEnt());
    }

Related puzzles: