Purpose of Index Tutorial: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 13: Line 13:
Next: [[Overview of Sort Tutorial|Sort]]<br>
Next: [[Overview of Sort Tutorial|Sort]]<br>
Back: [[Tutorial 2|Table of Contents]]
Back: [[Tutorial 2|Table of Contents]]
</noinclude>
<noinclude>
[[Category:Index and Sort Tutorial]]
</noinclude>
</noinclude>

Latest revision as of 01:40, 16 July 2013

The main reason we create index files is so that the user can quickly access any record by key, instead of sorting through all the records every time. On large master files, this saves time. Write a quick program, NAMEFIND to access records based on last names. This will involve the following steps:

  1. Prompting the user for a last name
  2. Opening the file
  3. Reading it by key (the last name input)
  4. Displaying the complete record

A more complicated program might then accept changes, print a label, or any number of other actions.

But wait! What if two people have the last name? Add lines to the program to solve this problem if the first search does not provide the correct person. See the solutions page for help.


Next: Sort
Back: Table of Contents