Friday, October 18, 2019

166. Qbasic sequential file handling to display all the information of employees along with tax amount (also tax is 15% of salary)

166.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).
OPEN "EMP.DAT" FOR INPUT AS #1
CLS
WHILE NOT EOF (1)
  INPUT #1, N$, P$, S
    T = 15 / 100 * S
PRINT N$, P$, S, T
WEND
CLOSE #1
END

2 comments: