To explore the concepts of programming language, an oriented on PASCAL programming environment was implemented in the HP Prime, which is easy to learn and understand. This programming environment, local and global variables and functions can be defined, as well as loops, branches or queries can be programmed. Similarly, an output of text and images is possible.
The example shows a program code for the "fig tree diagram" and the corresponding display output.
A handy tutorial for programming on the HP Prime can be found here.