Tuesday, 14 April 2020

Write a program to read the information form data file ‘STAFF.DAT” which consists many records with many fields name such as NAME, POST,DEPRTMENT and SALARY. WAP to display the records having salary greater or equal to 12000 or having post “MANAGER”.

Write a program to read the information form data file ‘STAFF.DAT” which consists many records with many fields name such as NAME, POST,DEPRTMENT and SALARY. WAP to display the records having salary greater or equal to 12000 or having post “MANAGER”.

Solution:

OPEN “STAFF.DAT” FOR INPUT AS #1

CLS

PRINT “NAME” ,”POST”, “DEPARTMENT”, “SALARY”

DO WHILE NOT EOF(1)

INPUT #1, N$, P$, D$, S

IF S>=12000 OR UCASE$(P$)=”MANAGER” THEN

PRINT N$, P$, D$, S

END IF

LOOP

CLOSE #1

END


No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint