programming assignment solution