Skip to main content

Posts

Showing posts from March, 2020

File Structure Lab Manual with Algorithms_Program3

Program 3. Write a program to read and write and student objects with variable-length records using any suitable record structure. Implement pack(), unpack(), modify() and search() methods. Algorithm: Step 1: Start Step 2: Enter the choice            1.Write 2. Display 3. Search 4. Modify 5.Exit            case 1: write() //Read the name, usn, age, sem, branch            case 2: unpack()                        display()            case 3: unpack()                        search()            case 4: unpack()                       search()                        modify() Step 3: Stop Algorithm: write() Step 1: Start Step 2: Enter the name, usn, age, sem, branch Step 3: call pack(t) function Step 4: Stop Algorithm: pack(t) Step 1: Start Step 2: Open a file hello.txt Step 3: copy the strings- name, usn, age, branch and concatenate in buffer Step 4: Now read length of buffer -strlen(buffer) Step 5: close a file Step 6: Stop Algorithm: unpack() Step 1: Start

File Structure Lab Manual with Algorithms_Program2

Prg2. Write a program to read and write and student objects with fixed-length records and the fields delimited by “|”. Implement pack(), unpack(),modify() and search() methods. Algorithm: Step 1: Start Step 2: Enter the choice            1.Write 2. Display 3. Search 4. Modify 5. Exit             case 1: write() //Read the name, usn, age, sem, branch             case 2: unpack()                         display()             case 3: unpack()                         search()             case 4: unpack()                         search()                         modify() Step 3: Stop Algorithm: write() Step 1: Start Step 2: Enter the name, usn, age, sem, branch Step 3: call pack(t) function Step 4: Stop Algorithm: pack(t) Step 1: Start Step 2: Open a file hello.txt Step 3: copy the strings- name, usn, age, branch and concatenate in buffer Step 4: Now read length of buffer -strlen(buffer) Step 5: close a file Step 6: Stop Algorithm: unpack() Step 1: Start S

File Structure Lab Manual with Algorithms_Program1

Program 1. Write a program to read series of names, one per line, from standard input and  write these names spelled in reverse order to the standard output using I/O  redirection and pipes. Repeat the exercise using an input file specified by the user  instead of the standard input and using an output file specified by the user instead of  the standard output. _ Algorithm: Step 1: Start Step 2: Enter your choice 1. From standard I/O 2. From Files Step 3: Select the choice- 1: Using Standard file 2: Using Files             Case 1: [using standard I/O]                          Enter the number of names to be read                          Read the value of N                          a. Read one name at a time                          b. call reverse(name) function                          display the reversed name on standard output                          Repeat a and b for N times             Case 2: [Using Files]                           Open the file for reading