Soumya S.

asked • 08/15/17

How can i print the last 5 records of a sequential data file using qbasic??

I already have a sequential data file created.!!!

1 Expert Answer

By:

David W. answered • 08/15/17

Tutor
4.7 (90)

Experienced Prof

Soumya S.

can you plz code it for me ?? my file "student.bas" contains name, class and roll no. of students.
Report

08/15/17

Soumya S.

can you plz code it for me ?? my file "student.bas" contains name, class and roll no. of students.
Report

08/15/17

David W.

This is pseudocode.
 
Many of the statements are actually valid BASIC.
 
The best plan is to start small -- with a working program -- then add small increments  (it's called the Spiral Process).  For example:
    Write a program that:
      1.  opens your file and prints the first line.; close file
 
      2.  opens your file and stores each line in a 1-element array; check for EOF and print the one line; close file
 
      3.  do the same for a 2-element array
 
       4.  do the same for a 5-element array
 
       5.  determine the order of the "last file" that you want; consider a file size of less than 5 records
Report

08/15/17

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.