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 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 Location + 1
ENDWHILE
IF NOT FoundFlag THEN
OUTPUT ".........................................................................................................."
ENDIF