Step 1:Declare an integer constant N=5, k and HASH.
Step 2:Declare an one-dimentional array of character ORIGINAL[N].
Step 3:k=1
Step 4:As long as k<51, repeat steps 7 to 9.
Step 5: Accept a character from the keyboard.
Step 6: Assign the character to ORIGINAL(k), the K th element ot ORIGINAL.
Step 7: Increment k by 1.
Step 8:Initialise the variable HASH to be 0.
Step 9:Calculate HASH by the following formula:
HASH=1*ORIGINAL(1)+2*ORIGINAL(2)+...+5*ORIGINAL(5)