Zadanie

V C++ naprogramuje immutable triedy A, B a C. Trieda A ma používať triedy B a C. Trieda B má používať triedu C. Triedy majú byť oddelené interfacami (prípadne inými vhodnými jazykovými konštruktami vynucujúcimi typovú korektnosť a umožňujúcimi náhradu triedy testovacím dvojníkom). Interface medzi B a C má byť menší ako interface medzi A a C, pričom trieda B nemá vedieť o ďalších možnostiach použitia triedy C. Naprogramujte jednoduché solitary unit testy pre triedy A a B. V prípade, že sa vám nepodarí všetky podmienky splniť, skúste nájsť vhodný kompromis.

Domácu úlohu odovzdajte na majlom na lukotka (zavinac) dcs.fmph.uniba.sk do 1.5.2026 22:00.

Assignment

Program immutable classes A, B, and C in C++.

Class A should use classes B and C. Class B should use class C.

The classes should be separated by interfaces (or other suitable language constructs that enforce type safety and allow replacing a class with a test double).

The interface between B and C should be smaller than the interface between A and C, while class B should not be aware of other possible uses of class C.

Implement simple solitary unit tests for classes A and B.

If you are unable to meet all the conditions, try to find a reasonable compromise.

Submit the homework by email to lukotka (at) dcs.fmph.uniba.sk by May 1, 2026, 22:00.