Program 3 for CS201