Saturday, December 28, 2019

4.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.


Ans:

CLS
OPEN “XYZ.REC” FOR INPUT AS #1
INPUT “Enter post to be searched”; S$
FLAG=0
WHILE NOT EOF(1)
INPUT #1, N$, P$, D$, S
IF UCASE$(S$)=UCASE$(P$) THEN
PRINT N$, P$, D$, S
FLAG=1
END IF
WEND
IF FLAG=0 THEN PRINT “Data not found”
CLOSE #1
END




No comments:

Post a Comment

File Handling

Introduction:- Data are used in all the programs for retrieving information. In QBASIC you can store data in a separate file called a da...