Page 457 - C++
P. 457

{strcpy(name[i],name[i+1]);
                       price[i]=price[i+1];
                       code[i]=code[i+1];}
                       name[i][0]='\0';
                       cout<<"\n\n\t\t Item deleted sucessfully!";
                       serial--;
                     }
                   else
                       cout<<"\n\n\t\t\a Code not found!";
                   cout<<"\n\n Do you want to delete another item?(press y/any other
                key):";
                   choice=getch();}while(choice=='y'||choice=='Y');
                }


                item universal;


                       //Item's screen
                void item::screen()
                {char choice;
                 do{clrscr();
                    cout<<"\n\t\t\tWelcome to Items screen!!!\n\n Choose an
                option:\n\n(1)Add an item\n\n(2)Display the menu\n\n(3)Edit
                inventory\n\n(4)Delete an item\n\n(5)Exit to previous
                screen\n\n\t\t\tYour choice(1-5):";
                    choice=getch();
                    switch(choice)
                         {case '1': universal.add();
                                   break;
                          case '2': universal.display();
                                   cout<<"\n\n\n\n\t\t\tPress a key...";
                                   getch();
                                   break;
                          case '3': universal.edit();
                                   break;
                          case '4': universal.del();
                                   break;
                          case '5': break;
                          default : cout<<"\n\n\a Wrong choice! Enter again";
                                   getch();
                                   break;}

                    }while(choice!='5');

                      cout<<"\n\t\t Returning to manager's screen...";
                      getch();
                }



                       //Fn for customer access
                void item::customer()
                {char choice,choice1;
   452   453   454   455   456   457   458   459   460   461   462