{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Dale - Computer Science Illuminated 185

Dale - Computer Science Illuminated 185 - 158 Chapter 6...

This preview shows page 1. Sign up to view the full content.

Sorting Putting a list of items in order, either numerically or alphabeti- cally Sort key The field to be used in the ordering 158 Chapter 6 Problem Solving and Algorithm Design we are going to translate the algorithm. We discuss the languages into which algorithms are translated in the next chapter. For this example, let’s assume 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 whether any data is missing. If data is missing, the user must be prompted to enter the missing data. We express this process by using the word If with an expression in parentheses. If the expression is true, the indented process is carried 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 not our problem at this level. We can defer these details to a later refinement.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}