Develop a simple text-based calculator that queries the user to enter a value, an arithmetic operator (+,-,*,/,%), and then another operand (value). If the user enters "q" at any time, the application should quit. If the user attempts division by zero (illegal operation in a computer), the application should prevent it.
The application should perform the indicated arithmetic and display the results to the user.