Event-driven programming
In an algorithm-driven program, the flow of the program is dictated by the predefined steps written in that program. The program may prompt the user with these instructions for an input. An example is a command-line application asking for user input in a predefined order.
In contrast, applications with a graphical user interface let the user dictate the program flow. The application waits for the user actions, and then responds to those actions. For example, if you are reading a PDF copy of a book, you can perform actions like jumping to the next page, zooming-in, scrolling down, or closing the window by clicking on the appropriate buttons. Here, you are essentially telling the application what to do next. This is called event-driven programming. Here, the control flow of the program is governed by the triggered events. The application responds to these events as they occur. The response could be changing the state of the graphical element or running some background...