solved assignment2 program