WAP in QBASC to enter the records of variable numbers of employee with the following details:
1) Employee ID
2) Full Name
3) Full Address
4) DOB
5) Post
6) Salary
Program:
CLS
OPEN "EMP.DAT" FOR OUTPUT AS #1
INPUT "How many records do you want to enter";N
FOR I=1 TO N
INPUT "Enter Employee ID";EID$
INPUT "Enter Employee fullname";FN$
INPUT "Enter Address";ADD$
INPUT "Enter DOB(mm-dd-yyyy)";DOB$
INPUT "Enter Post";P$
INPUT "Enter Salary"; S
WRITE #1, EID$,FN$,ADD$,DOB$,P$,S
NEXT I
CLOSE #1
END
OR
CLS
OPEN "EMP.DAT" FOR OUTPUT AS #1
repeat:
INPUT "Enter Employee ID";EID$
INPUT "Enter Employee fullname";FN$
INPUT "Enter Address";ADD$
INPUT "Enter DOB(mm-dd-yyyy)";DOB$
INPUT "Enter Post";P$
INPUT "Enter Salary"; S
WRITE #1, EID$,FN$,ADD$,DOB$,P$,S
INPUT "Do You want to add more records (Y/N)";CHOICE$
IF UCASE$(CHOICE$)="Y" THEN GOTO repeat
CLOSE #1
END