How to get formatted address by Google Maps API

This is an example procedural steps for getting level wised (City, State/Division, Country, Latitude, Longitude) geolocation from a given address string.

This example can be implemented on a input form where user will put his physical address and your system will store the additional information for further use like for generating location based query corresponding to that address. For example your system can suggest him near by places using his latitude, longitude by calling another google maps API.

The output should be: