database
manufacture(string,integer,real,integer,char)
predicates
getdetail
readdetail
goal
clearwindow,
getdetail,
readdetail.
clauses
getdetail:-
write("\nenter the name of item ="),
readln(Itemname),
write("\nenter the item code ="),
readint(Itemcode),
write("\nenter the quantity ="),
readint(Itemqu),
write("\nenter the price of item ="),
readreal(Itemprice),
write("\nenter the grade of item ="),
readchar(Itemgrade),
write(Itemgrade),
char_int(Itemgrade,Val),
Val >= 97,
Val <=104,
assertz(manufacture(Itemname,Itemcode,Itemprice,Itemqu,Itemgrade)),
write("\nDo you want to continue(y/n)= "),
readchar(Ans),
write(Ans),
Ans='y',
getdetail.
getdetail.
readdetail:- manufacture(Itemname,Itemcode,Itemprice,Itemqu,Itemgrade),
retract(manufacture(Itemname,Itemcode,Itemprice,Itemqu,Itemgrade)),
write("\nItem Name = ",Itemname),nl,
write("Item code = ",Itemcode),nl,
write("Item quantity = ",Itemqu),nl,
write("Item Price = ",Itemprice),nl,
write("Item grade = ",Itemgrade),nl,
fail.
readdetail.