hello guys iwas trying to code a supermarket cpp progam throiugh dev cpp am stuck for three dyas now please help it kept on sayi
/*----------Super Market Billing-------------*/ /*Header File*/ #include<iostream> #include<conio.h> #include<string.h> #include<stdio.h> #include<process.h> #include<fstream> void gotoxy(short x, short y); using namespace std ; /*Class*/ class product { int pno; char name[50]; float price,qty,tax,dis; public: product() { pno=000; strcpy(name,"..."); price=000; qty=000; tax=000; dis=000; } void create_product() { cout<<"Please Enter The Product No.of The Product: "; cin>>pno; cout<<"\n\nPlease Enter The Name ofThe Product: "; gets(name); cout<<"\nPlease Enter The Price of The Product: "; cin>>price; cout<<"\nPlease Enter The Discount(%): "; cin>>dis; } void show_product() { cout<<"\nThe Product No. of The Product: "<<pno; cout<<"\nThe Name of The Product: "; puts(name); cout<<"\nThe Price of The Product:"<<price; cout<<"\nDiscount: "<<dis; } int retpno() { return pno; } float retprice() { return price; } char* retname() { return name; } int retdis() { return dis; } }; //class ends here /*Global declaration for stream object,object*/ fstream fp; product pr; /*Function to write in file*/ void write_product() { fp.open("Shop.dat",ios::out|ios::app); pr.create_product(); fp.write((char*)&pr,sizeof(product)); fp.close(); cout<<"\n\nThe Product Has Been Created "; getch(); } /*Function to read all records from file*/ void display_all() { system("cls"); cout<<"\n\n\n\t\tDISPLAY ALL RECORD!!!\n\n"; fp.open("Shop.dat",ios::in); while(fp.read((char*)&pr,sizeof(product))) { pr.show_product(); cout<<"\n\n=============================\n"; getch(); } fp.close(); getch(); } /*Function to read specific record from file*/ void display_sp(int n) { int flag=0; fp.open("Shop.dat",ios::in); while(fp.read((char*)&pr,sizeof(product))) { if(pr.retpno()==n) { system("cls"); pr.show_product(); flag=1; } } fp.close(); if(flag==0) cout<<"\n\nrecord not exist"; getch(); } /*Function to modify record of file*/ void modify_product()