EvaluationUsing fixed loops

Appropriate use of coding constructs is evaluated to determine the efficiency of software as it relates to use of RAM. Software is measured against the functional requirements to evaluate fitness for purpose.

Part ofComputing ScienceSoftware design and development

Using fixed loops

Here are two examples of code written in Reference Language that will ask for the name of ten cities.

In the first example, no fixed loop is used. This is less efficient than the second example, where a fixed loop has been used to receive user input.

Table showing efficient ( FOR i FROM 0 TO 10 DO, RECEIVE city(i) FROM (STRING) KEYBOARD, END FOR) and inefficient loops