I need a program that can be use in store (OUR PROJECT)

I need to do all this .

View all the product records - done with this
Add New Item - no codes for this yet.
Delete Item - not sure if my codes are right menu #3
Edit Item - no codes for this yet.
Search Item - not sure if my codes are right menu #5

I wish someone could help me

bool getpassword()

{
for(int i = 0; i < 3; i++)
{
string password;
cout << "Enter the password: ";
getline(cin, password);

if (password == "finalcpp")
return true;
cout << "INVALID PASSWORD INTRUDER. \n";
}
return false;
}


int main()
{
float prodid[5]={1,2,3,4},descrip[5],quant[5],price[5];
string pass;
char ans;
int menu,ctr,prodid1;

cout<<"\t\t\tPang poging sari sari store"<<endl;
cout<<" #1 - View Record \n #2 - Add Item \n #3 - Delete Item \n #4 - Edit Item \n #5 - Search \n #6 - Make a transaction \n #7 - View Transaction Records \n #8 - Exit \n";
cout<<"Choose one:\n";
cin>>menu;
clr;



if(menu==1)
{


cout<<"Product ID \tDescription \tQuantity \tPrice"<<endl;
cout<<"1 \t\tPiattos \t 50 \t\t 10"<<endl<<"2 \t\tMax \t\t 50 \t\t 1"<<endl<<"3 \t\tCotton \t\t 50 \t\t 20"<<endl<<"4 \t\tAlcohol \t 50 \t\t 35"<<endl;

}




if(menu==3)
{
cout<<"Enter Product ID that you wanted to delete:\n";
cin>>prodid1;

if(prodid1=prodid[5])
{
cout<<"Product ID \tDescription \tQuantity \tPrice"<<endl;
cout<<"\n\t"<<prodid[ctr]<<"\t"<<descrip[ctr]<<"\t"<<quant[ctr]<<"\t"<<price[ctr];

}
else
{
cout<<"Sorry! Thats a wrong Product ID"<<endl;
}


}



if(menu==5)
{
cout<<"Enter Product ID:\n";
cin>>prodid1;

if(prodid1=prodid[ctr])
{

cout<<"Product ID \tDescription \tQuantity \tPrice"<<endl;
cout<<"\n\t"<<prodid[ctr]<<"\t"<<descrip[ctr]<<"\t"<<quant[ctr]<<"\t"<<price[ctr];


}
}


if(menu==8)
{
cout<<"\n\n\t\t\t\tBYE BYE BYE"<<endl;
exit(1);

}




return 0;

}
Last edited on
We can't help without code.

Make sure your code is [code]between code tags[/code] so that it has syntax highlighting and line numbers, as well as proper indentation.
Topic archived. No new replies allowed.