Search code examples
pseudocode

Pseudocode: Confusing syntax "<>" and "variable:2:6"


I am currently studying pseudo code, and despite my 3 year history in programming, this 1 particular practice-exam question has me perplexed with its unconventional code (shown below):

enter image description here

Highlighted in Pink, are my 2 main problems with the code. I have experience across 3 languages, yet I have never encountered the control flow method <>, and cannot imagine exactly what it would be used for. In addition to this, the variable average appears in the code in the form of "average:6:2", for which I am equally clueless.

To Summarise:

  • What is the function of the control flow method "<>"
  • As is stated in question (a) in the image above, what is the purpose of 'average:6:2'?

Solution

    1. <> is common for not equal

      While number is not equal to 999
      
    2. number:filed_width:precision is pascal formatter for real number with filed_width being the space for field and precision is numer of digits after dot. so 3.141519:4:1 will print <space>3.1