Friday, August 9, 2024

QBASIC FILE HANDLING PROGRAMS

QBASIC FILE HANDLING PROGRAMS 

1. Write a program to store Roll no., Name, Class and Address of any five students. [SEE 2074]

2. A sequential data file called “student.dat” contains same records under the field’s name, english, nepali and computer. Write a program to add some more records in the same sequential data file. [SLC 2068]

3. A sequential data file “RECORD.DAT” and store Name, Address and Salary of employees of an office. WAP to add some more records in the data file “RECODR.DAT”. The program should terminate with user choice.

4. Create a data file to store the records of few employees having Name, Address, Post, Gender and Salary fields. [SEE 2073]

5. Create a sequential data file ’Price.dat’ to store item name, quantity and Rate also calculate total amount(total=Quantity X Rate).Program should terminate according to the user’s choice. 

6. Create a sequential data file’post.dat’ to store name and marks of any three subjects also calculate total and percentages only for 15 students.

7. Store SIDNO, name, address and Telephone number of five students and display the records on monitor in sequential data file “STDINFO”

8. A sequential data file “Address.inf” contains serial no, name, address, telephone and email_id.WAP to record as many records as the user wants. The serial number should be generated automatically like 5001,5003,5005.

9. A Sequential data file called "SEE.DAT" has stored data under the field heading Symbol No., Name, English, Nepali, and Computer. Write a program to display all the information of those students whose marks in Computer is more than 80.

10. A sequential data file “STD.TXT” contains name and marks in three different subjects of some students. Write a program to display only fail student’s records assuming pass marks 40.

11.Write a program which reads records from the file ”Result.DAT” having the fields name, and marks of three different subjects and display only those records whose percentage is greater than 60 and less than 80. Also count the total number of records presenting in that data files.

12. Write a program to read all the records from the data file “STUDENT.TXT” and display all the records where the fields name are unknown.

13. A data file "pabson.txt" contains the records composed of the fields like school, principal, address, contact. Write a program in Qbasic to display records of the schools located in either Kathmandu or Palpa

14. A data file “INFO.DAT” has numerous records in it with name, address age, and telephone numbers in it. Write a program to read all the records and print those with address “NEPAL” and age >15

15. A sequential data file called 'ADDRESS.DAT' contains NAME, AGE, CITY and TELEPHONE fields. Write a program to display all the contents of that data file.

16. A data file “lib.txt” consists of book’s name, author’s name and price of books. Write a program to count and display the total number of records present in the file.

17. Write a program in QBASIC to open a sequential data file “EMP.DAT”, which contains employees records: Name, address and phone number and display all the records as well as total number of records stored in the file. 

18. A sequential data file named “nabil.txt” contains record of clients of a bank including depositor’s name, deposited amount, time and rate of interest. Wap to display detail of all depositors including simple interest.

19. A sequential data file “SALARY.DAT” contains the information, Employee-Code, Employee-Name, Post, Basic-Salary. Write a program to display those records whose Basic-salary is between 10000 to 15000 and Post is ‘OFFICER’.

20. A data file name “EMP.DAT”, contains number of records having fields name, post and salary. Write a program to count total number of “Manager” in the data file. (hint: Manager is a post)

21. A sequential data file “emp.dat” contains name, post and salary fields of information about employees. Write a program to display all the information of employees along with tax amount (also tax is 15% of salary).

22. A data file “Salary.Dat” contains the information of employee regarding their name, post and salary. Write a program to display all the information of employee whose salary is greater than 15000 and less than 40000.

23. Write a program that reads the ”INFO.DAT” file that has several record such as name, address, gender, post, and salary .The program display those record whose sex is male and salary more than 10,000 and also the program counts the total number of records in that file.

24. A sequential data file’post.dat’ has few records related to name, address, salary.WAP to display the records whose address begins with ‘S’ or ‘D’

25. Write a program to open a data file “record.dat” that contains name, address, date of birth, email and telephone number of some employees. Now display all those records whose date of birth is in current month.

26. A sequential data file “Record.dat” has few records related to name, address, post and DOB(mm/dd/yyyy). WAP to display the records of all those who were born between 1971 to 1999.

27. Write a Qbasic program that read the "EMP.DAT" file with Name, Address, Post and Salary columns from E: drive that has 500 records of employees and displays only its last 50 records.

28. A sequential data file has 100 records having field name, class and roll number. Write a program to display from 50th to 60th records.

29. Write a program to display the first 10 records from a file named “resource.dat” having fields name, phone and email.

30. A data file named “EMP.DAT” contains some records with the fields Code, Name, Post and Salary. Write a program to print odd position records of the data file.

31. A sequential data file named “abc.dat” has several records having fields name, roll and class. Write a program to copy all the records of class 10 into a newly created file new.dat.

32. A data file named “record.dat” contains name, age and salary for n number of persons. Write a program to input a name to search data from a data file. If the data is not found, then display the message “Data not found in the list”.

33. A sequential data file 'Student.dat' contains registration number, student name, address and date of birth of some students. Write a program that asks a user to input a registration number and displays the record of the particular registration if present.

 

34. WAP that asks a post of the employee and displays his/her records from the sequential data file “XYZ.REC” having fields Name, Post, Dept and Salary.

35. Delete some records from “neps.dat” file where computer ask user to enter the record, which is to be deleted. (Fields are name, address, and telephone number)

36. A sequential data file “marks.dat” contains information such as student’s name, marks obtained in math, science and computer. Write a program that increase the marks of computer by 10 of those student who secured less than 40

37. A sequential data file “RECORD.DAT” contains different records under fields: name rollno., name, address and percentage. Write a program to edit a record and display both edited and unedited records on the screen to compare them side by side.


1 comment:

  1. Great overview of QBASIC file handling programs! They're key for data management. Check out hekate switch for more tips!

    ReplyDelete