Step-by-step explanation:
In general, when a program runs in text-based environment like command line interface, the program is used for determining the order in which things happen.
As the program runs, the user will not have any choice and he or she can enter the required data.
If the user enters the data in required format then, he/she can get the result or output in desired format.