Write program code to access individual fields of records under each of the following circumstances. For each case, state the assumptions you make concerning pointers, separator characters, and so on. Determine the type of information needed in the file header in order for your code to be general in each case.
a. Fixed-length records with unspanned blocking
b. Fixed-length records with spanned blocking
c. Variable-length records with variable-length fields and spanned blocking
d. Variable-length records with repeating groups and spanned blocking
e. Variable-length records with optional fields and spanned blocking
f. Variable-length records that allow all three cases in parts c, d, and

Notes:

  • ints are 4 bytes
  • delimiter of records are 1 byte
  • record ends are 1 byte
  • so record is exactly 25B
  • Sudo Code:
    (ptr)starting_location=100;
    record_to_access = x;
    x = 5;
    y = 2;
    record_size=25;
    (ptr)record_field_to_access = starting_location+(record_size*record_to_access)+y;


    Notes:

    assuming delimiters are '/' and each pointer starts with '#' (which is arbitrary) assume the fifth record is in another blocking than the starting point

    Sudo Code:
    (ptr)starting_location=100;
    record_to_access = x;
    x = 5;
    y = 2;
    record_size=25;
    loop{


    (every byte look for a '#' if '#' is present, current location = the pointer following it after every 25B, increment z by 1 and stop when other loop is finsihed;)
    if (z == 4);
    {

    loop{
    (increment through record byte by byte, if current location contains '#', go back to the following pointer when we're at the correct field;)
    }
    }

    }

    18.19

    Picture 1