Program 4 for CS201