A pseudocode algorithm searches for a customer record in a random file AccountRecord.dat. A user inputs the name of the customer.
The records are stored using the user‑defined data type TAccount.
TYPE TAccount
DECLARE AccountNumber : INTEGER
DECLARE Name : STRING
DECLARE Address : STRING
DECLARE Telephone : STRING
ENDTYPE
If the record is found, it is output, otherwise an error message is displayed.
Complete the file handling pseudocode.
DECLARE Customer : TAccount
DECLARE Location : INTEGER
DECLARE MaxSize : INTEGER
DECLARE FoundFlag : BOOLEAN
DECLARE SearchCustomer : STRING
MaxSize format('truetype')%3Bfont-weight%3Anormal%3Bfont-style%3Anormal%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctext%20font-family%3D%22math1670c26185a3783678135b4697f%22%20font-size%3D%2216%22%20text-anchor%3D%22middle%22%20x%3D%2210.5%22%20y%3D%2216%22%3E%26%23x2190%3B%3C%2Ftext%3E%3C%2Fsvg%3E)
1000
OPENFILE ...............................................................................................................
Location
1
...............................................................................................................
FALSE
OUTPUT "Enter the customer’s name"
...............................................................................................................
................................................................................... AND Location <= MaxSize
................................... "AccountRecord.dat", ............................................
GETRECORD "AccountRecord.dat", Customer
IF SearchCustomer = Customer.Name THEN
OUTPUT "Customer found: "
OUTPUT Customer // output customer record
FoundFlag
TRUE
ENDIF
Location format('truetype')%3Bfont-weight%3Anormal%3Bfont-style%3Anormal%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctext%20font-family%3D%22math1670c26185a3783678135b4697f%22%20font-size%3D%2216%22%20text-anchor%3D%22middle%22%20x%3D%2210.5%22%20y%3D%2216%22%3E%26%23x2190%3B%3C%2Ftext%3E%3C%2Fsvg%3E)
Location + 1
ENDWHILE
IF NOT FoundFlag THEN
OUTPUT ".........................................................................................................."
ENDIF