Program 5 for CS201