Jayesh A Lalwani wrote:Rico,
Your algorithm for computing the total watch time is wrong. It doesn;t take into account overlaps between movie times
Thank you for pointing that out as it won't prove to be helpful... Guess I was too eager to make a suggestion
The implementation is also too low level by using arrays I guess
Here is my attempt at providing an improved solution:
Improved Movie class:
Improved MovieMarathon class:
Improved Cinema test class:
I should mention again that this suggestion is not to be taken as a template to use but only as my thoughts on the design path I would have took at implementing the application instead of using arrays which could probably give the OP an insight on a different approach.