I have to write a program that accepts a URL from the user and
splits it into its 3 major components.

For example:
If your string is:

http://www.cnn.com/~cse110

your output should be

Protocol : http
Address : www.cnn.com
Resource : ~cse110