SortingPutting a list ofitems in order, eithernumerically or alphabeti-callySort keyThe field tobe used in the ordering158Chapter 6Problem Solving and Algorithm Designwe are going to translate the algorithm. We discuss the languages intowhich algorithms are translated in the next chapter. For this example, let’sassume that the level of detail is sufficient for this module.So now, we go back to the second level 0 module:Fill in missing data.The algorithm must go through each of the names and determine whetherany data is missing. If data is missing, the user must be prompted to enterthe missing data. We express this process by using the wordIfwith anexpression in parentheses. If the expression is true, the indented process iscarried out; if the expression is not true, the indented process is skipped.So we must check each of the four data items to see if data is missing.How does the algorithm determine if a data item is missing? That’s notour problem at this level. We can defer these details to a later refinement.
This is the end of the preview.
access the rest of the document.