I really don't know what the problems occurs inside this coding. I do not have any idea what this error means. If anybody can help me I would be so grateful.
#include<string>
#include<iostream>
#include<stdlib.h>
using namespace std;
int num=1;
int counterforanalog=0;
int counterfordigital=0;
int counterforsmartwatch=0;
class watch
{
private:
int watch_id;
string brand;
double price;
string colour;
int date;
public:
watch()
{
watch_id=0;
brand="";
price=0;
colour="";
date=0;
}
void adddata()
{
cout<<"Please Enter Watch ID:";
cin>>watch_id;
cin.ignore();
cout<<"Please Enter Watch Brand:";
getline(cin,brand);
cout<<"Please Enter Price: Rm ";
cin>>price;
cout<<"Please Enter Watch colour:";
getline(cin,colour);
cout<<"PLease enter date:";
cin<<date;
system("cls");
cout<<endl<<endl<<"New item has been succesfully added!"<<endl;
system("pause");
}
void editdetail()
{
int a=0;
cout<<watch_id<<"\t"<<brand<<"\t"<<price<<"\t"<<date<<endl;
HD: cout<<"Do you want to continue editing?"<<end1;
cout<<"\t1:YES\t2:NO"<<endl;
cin>>a;
if(a==1)
{
cout<<"\nPlease Enter New Watch ID of the watch:"<<endl;
cin>>watch_id;
cout<<"\nPlease Enter New brand of the watch:"<<endl;
getline(cin,brand);
cout<<"\nPlease Enter New price of the watch:"<<endl;
cin>>price;
cout<<"Insert date today:"<<end1;
cin>>date;
system("cls");
cout<<"Data has been updated@edited"<<endl;
system("pause");
}
else if(a!=2&&a!=1)
{
cout<<"\nWrong instruction.PLease choose again"<<endl;
goto ED;
}
AB: cout<<"________________________________________________________________________________\n";
cout<<"\t ! *************************************** \t!\n";
cout<<"\t ! * NewGenWatches management system * \t!\n";
cout<<"\t ! *************************************** \t!\n";
cout<<"________________________________________________________________________________\n";
cout<<"Choose Watch type:\n1.Analog\n2.Digital\n3.Smartwatch"<<endl;
cin>>choiceofevent;
if(choiceofstock==1)
{
while(choiceofmenu!=6)
{
analog.menu();
cin>>choiceofmenu;
if(choicefmenu==1)//add record
{
analog.add(counterofanalog);
counterofanalog++;
}
if(choiceofmenu==2)//delete record
{
cout<<"Enter watch ID of the watch that want to delete:";
int tempid;//temporary id for delete record
cin>>tempid;
int x=analog.deletedata(tempid,counterofanalog);
counterofanalog=x;
}
if(choiceofmenu==3)//edit reccord
{
int temid;//temporary id for edit record
cin>>temid;
analog.editdetails(temid,counterofanalog);
}
if(choiceofmenu==4)//view record
analog.view(counterofanalog);
if(choiceofmenu==5)//exit
{
system("cls");
goto AB;
}
}
}
else if(choiceofstock==2)
{
while(choiceofmenu!=6)
{
system("cls")
digital.menu();
cin>>choiceofmenu;
if(choicefmenu==1)//add record
{
digital.add(counterofdigital);
counterofdigital++;
}
if(choiceofmenu==2)//delete record
{
cout<<"Enter watch ID of the watch that want to delete:";
int tempid;//temporary id for delete record
cin>>tempid;
int x=digital.deletedata(tempid,counterofdigital);
counterofdigital=x;
}
if(choiceofmenu==3)//edit reccord
{
int temid;//temporary id for edit record
cin>>temid;
digital.editdetails(temid,counterofdigital);
}
if(choiceofmenu==4)//view record
digital.view(counterofdigital);
if(choiceofmenu==5)//exit
{
system("cls");
goto AB;
}
}
}
else if(choiceofstock==3)
{
while(choiceofmenu!=6)
{
system("cls")
smartwatch.menu();
cin>>choiceofmenu;
if(choicefmenu==1)//add record
{
smartwatch.add(counterofsmartwatch);
counterofsmartwatch++;
}
if(choiceofmenu==2)//delete record
{
cout<<"Enter watch ID of the watch that want to delete:";
int tempid;//temporary id for delete record
cin>>tempid;
int x=smartwatch.deletedata(tempid,counterofsmartwatch);
counterofsmartwatch=x;
}
if(choiceofmenu==3)//edit reccord
{
int temid;//temporary id for edit record
cin>>temid;
smartwatch.editdetails(temid,counterofsmartwatch);
}
if(choiceofmenu==4)//view record
smartwatch.view(counterofsmartwatch);
if(choiceofmenu==5)//exit
{
system("cls");
goto AB;
}
}
}
else
{
cout<<"Wrong input.\nPlease enter your choice again.\n"<<endl;
system("pause");
system("cls");
goto AB;
}
}
You have a rather large number of errors in your code. Picking one of them out of the bunch isn't likely to be helpful, unless it happens to be the first error that appears in your compiler's output.