Is there another way to write this program?

Printable View