Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
//Main Strings
std::string Password;
std::string AdministratorPassword;
//Main Menu
std::string MainMenu;
//Edit Menu
std::string EditMenu;
std::string AddItem;
std::string EditItem;
cout<<"Welcome to the UK Memory.com inventory system \n Enter Your Password then press enter to continue! \n";
std::cin >> Password;
while (Password != "test")
{
std::cout<<"Incorrect Password \n Please Re-enter your password \n";
std::cin >> Password;
}
//I need to add multiple password support, and user configurable passwords
if (Password == "test")
std::cout<<"Welcome User \n What would you like to do now? \n 1> Lookup item. \n 2> Packing mode. \n 3> Edit mode. \n \n \n Enter your selection. \n " ;
//Menu Selection Start Here.
std::cin >> MainMenu;
if (MainMenu == "1")
std::cout<<"Lookup Mode selected \n Please scan the item's barcode and press enter, or type other for more options." ;
if (MainMenu == "2")
std::cout<<"Packing Mode selected \n Scan the order barcode to begin." ;
if (MainMenu == "3")
std::cout<<"Edit Mode selected \n Please enter administrative password to begin. \n" ;
std::cin >> AdministratorPassword;
while (AdministratorPassword != "admin")
{
std::cout<<"Incorrect Password \n Please Re-enter your password \n";
std::cin >> AdministratorPassword;
}
if (AdministratorPassword == "admin")
std::cout<<"Edit Mode confrimed \n Please select an option. \n 1> Add item \n 2> Edit item \n 3> Delete iten. \n 4> Password configuration \n" ;
std::cin >> EditMenu;
if (EditMenu == "1")
std::cout<<"Add item mode. \n Please enter the item's details using the following syntax \n Item Number ; Item Barocde ; Item Name ; Stocked quantity \n" ;
std::cin >> AddItem;
if (AddItem != "*******;*******;********;********" )
std::cout<<"Syntax incorrect. The correct syntax for this operation is...\n Item Number ; Item Barocde ; Item Name ; Stocked quantity";
if (EditMenu == "2")
std::cout<<"Edit item mode." ;
if (EditMenu == "3")
std::cout<<"Delete item mode." ;
if (EditMenu == "4")
std::cout<<"Password configuration mode. \n Please re-enter administrative password \n" ;
std::cin >> AdministratorPassword;
while (AdministratorPassword != "admin")
{
std::cout<<"Incorrect Password \n Please Re-enter your password \n";
std::cin >> AdministratorPassword;
}
if (AdministratorPassword == "admin")
std::cout<<"Password configuration mode confirmed." ;
}
//Edit mode needs another menu, giving access to various options including, adding / editing items, password editing ect.
When I go to edit mode, then try to access option 2 3 or 4, it doesn't do anything which I suspect is to do with line 59 interfering with the selection choice. How Do I fix this?