Problem with array of objects from a class

The code worked fine with size at the bottom though…