Tuesday 14 April 2020

Write a program to open a data file (STAFF.DAT) in output mode and store information of employees. Data file store information such as employee name, post , department and salary of five different persons.

 Write a program to open a data file (STAFF.DAT) in output mode and store information of employees. Data file store information such as employee name, post , department and salary of five different persons.

Solution;

CLS

OPEN “STAFF.DAT” FOR OUTPUT AS #1

FOR I= 1 TO 5

INPUT “ENTER THE NAME”;N$

INPUT  “ENTER THE POST”;P$

INPUT”ENTER THE DEPARTMENT”;D$

INPUT”ENTER SALARY”;S

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

NEXT I

CLOSE #1

END


No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint