Friday, October 18, 2019

150. Qbasic sequential file handling to store item name, quantity and Rate also calculate total amount

150.Create a sequential data file ’Price.dat’ to store item name, quantity and Rate also calculate total amount(total=Quantity X Rate).Program should terminate according to the user’s choice. 
OPEN “price.dat” FOR OUTPUT AS #1
TOP:
CLS
INPUT “Enter Item Name”; N$
INPUT “Enter Quantity”; Q
INPUT “Enter Rate”; R
T = Q * R
WRITE #1, N$, Q, R, T
INPUT “Do you want to continue”; CH$
IF CH$=”Y” OR CH$ = “y” THEN GOTO TOP
CLOSE #1
END

No comments:

Post a Comment