The program is structured using def, while, and if statements to organize and control the execution of the algorithm. First, the def keyword is used to define a function. This allows the program to ...