Cubs who slept in cardboard boxes while learning about homelessness raised more than £1,000 for two charities.