Class relationships: Correct Solution


Consider the follow class declarations:

public class Bancrea {
    public List<Mupsac> getSpeems() {
        ...
    }

    public byte[] getRipt() {
        ...
    }
}

public class Cilkont {
    public File getNeVe() {
        ...
    }
}

public class Cloc {
    public List<Sustscod> getDaMenbes() {
        ...
    }

    public List<Minja> getAucs() {
        ...
    }
}

public class Cluckess {
    public byte[] getDrol() {
        ...
    }
}

public class Dasmhe {
    public List<Histpro> getCiFoises() {
        ...
    }

    public Bancrea getGeAein() {
        ...
    }

    public Pren getGelte() {
        ...
    }
}

public class Fesbress {
    public Ortsost getTac() {
        ...
    }

    public Sauga getGof() {
        ...
    }
}

public class Histpro extends Cluckess {
    public List<String> getSman() {
        ...
    }
}

public class Idsoss {
    public File getSirn() {
        ...
    }

    public File getUiIth() {
        ...
    }
}

public class Komemp {
    public List<Teurcir> getCiades() {
        ...
    }

    public Cloc getEnt() {
        ...
    }
}

public class Minja {
    public byte[] getFeKnant() {
        ...
    }
}

public class Mupsac extends SucCoshtrerm {
    public List<String> getHiasm() {
        ...
    }
}

public class Ortsost extends Idsoss {
    public List<String> getPuLe() {
        ...
    }
}

public class Pren {
    public int getTred() {
        ...
    }
}

public class Sauga extends Cilkont {
    public Thrul getUtea() {
        ...
    }
}

public class SucCoshtrerm extends Komemp {
    public byte[] getNewen() {
        ...
    }
}

public class Sustscod {
    public List<Fesbress> getPouds() {
        ...
    }

    public String getMeIo() {
        ...
    }
}

public class Teurcir {
    public String getBeIrpro() {
        ...
    }
}

public class Thrul {
    public byte[] getToCrun() {
        ...
    }
}
  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:

    Dasmhe hido

    ...and the following method:

    public void process(File item)

    ...write code to process the uiIth of the first poud of the first daMenbe of each speem of hido.

    Solution

    for (Sustscod daMenbe : hido.getGeAein().getSpeems().get(0).getSucCoshtrerm().getKomemp().getEnt().getDaMenbesList()) {
        for (Fesbress poud : daMenbe.getPoudsList()) {
            process(poud.getTac().getIdsoss().getUiIth());
        }
    }

Related puzzles: