help on void add and void delete function

Erm.tis coding still havent completed.I have stucked in void add_new and void delete.Anyone can help?

#include<iostream>
#include<conio.h>
#include <cstring>
#include<string>
using namespace std;
struct Watch
{
char watchname[50];
int watch_id;
int amount;
float price;
};

class invet
{
private:
int amount;
int watch_id;
string watchname;
float price;
public:
void printWatch( struct Watch *watch );
void delet(void);
void edit_items(void);
void add_new(void);
void show(void);
};

void invet::add_new(void)
{
system("CLS");
cout<<"Enter the following inventory data: "<<endl;
cout<<"=======================Description=======================";
cout<<"\nEnter Watch Name:";
cin>>watchname;
cout<<"\nEnter Amount:";
cin>>amount;
cout<<"\nEnter Watch Id:";
cin>>watch_id;
cout<<"\nEnter Watch Price:";
cin>>price;
}
void invet::show(void)
{
system("CLS");
cout<<"\n=======================INVENTORY======================="<<endl;
}
void invet::delet(void)
{
system("CLS");
cout<<"\nEnter product code:\n";
cin>>watch_id;
if(watch_id=101)
watch1.amount--;
else
watch2.amount--;
cout<<"\nThe watch is deleted from the list\n";
}

void printWatch( struct Watch *watch )
{

cout << "WATCHNAME : " << watch->watchname <<endl;
cout << "AMOUNT : " << watch->amount <<endl;
cout << "WATCH ID : " << watch->watch_id <<endl;
cout << "PRICE(RM) : " << watch->price <<endl;
cout<<"\n";
}
int main()
{
struct Watch Watch1;
struct Watch Watch2;

invet d[10];
static int j=0;
int x,i=0,p,s=0,watch_id;
system("CLS");
do{
cout<<"\nENTER YOUR CHOICE:\n";
cout<<"\n=======================MENU=======================";
cout<<"\n1. Show all stored items:";
cout<<"\n2. Add a new item:";
cout<<"\n3. Delete an item:";
cout<<"\n4. Edit Information of existing watch:";
cout<<"\n5. Exit\n";
cin>>x;
switch(x)
{ case 1: d[i].show();
strcpy(Watch1.watchname, "Analog Watch");
Watch1.amount=5;
Watch1.watch_id = 101;
Watch1.price=150;

strcpy(Watch2.watchname, "Digital Watch");
Watch2.amount= 5;
Watch2.watch_id = 201;
Watch2.price= 100;
printWatch( &Watch1 );

printWatch( &Watch2 );
break;
case 2: d[i].add_new();
d[i].show();
break;
case 3: d[i].delet();
break;
case 4:d[i].delet();
i++,j++;
break;
case 5: break;
}
} while(x!=5);



return 0;


}
write your code in proper source code format after that i will read this..
To repeat what Butch said but in a non-cryptic way.

Please edit your post and put all of your code between code tags. Its under the format section and the icon looks like this <>. Mark all of your code and then click it.
Topic archived. No new replies allowed.