char i,username[50],password[50];
cout<<"enter the username\n"
<<"enter the password\n";
cin>>username[i];
cin>>password[i];
if(username=="administration" && password=="admin")
{
//An administrator is responsible for registering the users
admin();
{
int n;
cout<<"enter the number of users";
cin>>n;
for(i=0;i<=n;i++)
cout<<"enter the username & password";
cin>>username;
cin>>password;
}
}
if(username=="manager" && password=="manager")
{
// Managers are responsible for monitoring stock levels and sales
manager();
{
display();
{
cout<<"sales for a particular day is:"<<s;
}
}
if(username=="sales assistants" && password=="sales")
{
// Sales Assistants are responsible for capturing sales
sales();
{
int br,qty;
cout<<"enter the no. of sales";
cin>>s;
cout<<"enter the barcodes of each item";
cin>>br;
cout<<"enter the quantity of items";
cin>>qty;
}
}
system("pause");
return 0;
}
}
here are the errors
[Linker error] undefined reference to `manager()'
[Linker error] undefined reference to `display()'
[Linker error] undefined reference to `sales()'
#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
usingnamespace std;
void admin();
int main()
{
...
}
admin()
{
int n;
cout<<"enter the number of users";
cin>>n;
for(i=0;i<=n;i++)
cout<<"enter the username & password";
cin>>username;
cin>>password;
}
Accidentally what you wrote is legal, but not what you intended
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
...
if(username=="administration" && password=="admin")
{
//An administrator is responsible for registering the users
admin(); // This calls admin();
{ // The following is part of main()
int n;
cout<<"enter the number of users";
cin>>n;
for(i=0;i<=n;i++)
cout<<"enter the username & password";
cin>>username;
cin>>password;
}
}
...