Vous êtes sur la page 1sur 5

#include<iostream>

#include<stdlib.h>
using namespace std;
int main()
{
string user[50],pass[50],email[50],mobile[50];
int flag=0,flag1=0,flag2=0,flag3=0;
string master,username;
int credit[50]={0},debit[50]={0},manageroption,option,deposit[50]={0},loan[5
0]={0};
int account=0,k=0,m=0,x=0;
int total_loan=0,total_depo=0;
int masterpass=0;
mainscreen:
cout<<"@@@@@@@@ _____WELCOME TO NITTE COOPERATIVE SOCIETY_____ @@@@@@@@"<<en
dl;
cout<<"1. >Manager"<<endl;
cout<<"2. >Customer"<<endl;
cin>>option;
if (option==1)
{
remaster:
cout<<"enter master password"<<endl;
cin>>master;
if(master=="nitte")
{
cout<<"Welcome Manager"<<endl;
repeat:
cout<<"\t\t1.Create New account"<<endl;
cout<<"\t\t2.Credit"<<endl;
cout<<"\t\t3. Debit"<<endl;
cout<<"\t\t4. Loan"<<endl;
cout<<"\t\t5. Balance Sheet"<<endl;
cout<<"\t\t6. View all the registered accounts"<<endl;
cout<<"\t\t7. Sign Out and go to main screen"<<endl;
cin>>manageroption;
if (manageroption==1)
{
cout<<"Enter username:\t";
cin>>user[account];
cout<<"Enter password:\t";
cin>>pass[account];
cout<<"Enter Mobile number:\t";
cin>>mobile[account];
cout<<"enter email:\t";
cin>>email[account];
cout<<"enter initial deposit:\t";
cin>>deposit[account];
account++;
goto repeat;
}
else if (manageroption==2)
{
cout<<"enter username"<<endl;
cin>>username;
k=account-1;

if(account==0)
{
cout<<"create user account then try\n";
goto mainscreen;
}
for(k=0;k<account;k++)
{
if(username==user[k])
{
flag1=1;
cout<<"enter amount to be deposited\t:";
cin>>credit[k];
deposit[k]=deposit[k]+credit[k];
goto repeat;
}
if(flag1==0)
{
cout<<"invalid user name\n";
goto mainscreen;
}
else
{
goto mainscreen;
}
}
}
else if (manageroption==3)
{
cout<<"enter username"<<endl;
cin>>username;
//cout<<"enter debit amount\n";
k=account-1;
if(account==0)
{
cout<<"create user account then try\n";
goto mainscreen;
}
for(k=0;k<account;k++)
{
if(username==user[k])
{ flag2=1;
cout<<"enter amount to be debited\t:";
cin>>debit[k];
deposit[k]=deposit[k]-debit[k];
goto repeat;
}
if(flag2==0)
{
cout<<"invalid user name\n";
goto mainscreen;
}
}
}
else if(manageroption==4)

{
cout<<"enter username"<<endl;
cin>>username;
cout<<"enter loan amount\t";
k=account-1;
if(account==0)
{
cout<<"create user account then try\n";
goto mainscreen;
}
for(k=0;k<account;k++)
{
if(username==user[k])
{
flag3=1;
cin>>loan[k];
goto repeat;
// deposit[k]=deposit[k]-debit[k];
}
if(flag3==0)
{
cout<<"invalid user name\n";
goto mainscreen;;
}
}
}
else if(manageroption==5)
{total_loan=0;total_depo=0;//******
cout<<"Total Loan taken by the customers:\t";
m=account-1;
for (m=0;m<account;m++)//*****
total_loan=total_loan+loan[m];
cout<<total_loan<<endl;
cout<<"total deposit by the customers:\t";
m=account-1;
for (m=0;m<account;m++)//*****
total_depo=total_depo+deposit[m];
cout<<total_depo<<endl;
goto repeat;//****
}
else if(manageroption==6)
{
cout<<"total accounts are:\n"<<account<<endl;
x=account-1;
for (x=0;x<account;x++)//****
{
cout<<"username:\n"<<user[x]<<endl;
// cout<<"password:\n"<<pass[x]<<endl;
cout<<"profile details are:\n"<<email[x]<<endl<<mobile[x]<<e
ndl<<deposit[x]<<endl<<loan[x];
goto repeat;
}
}
else if(manageroption==7)//*****
{

goto mainscreen;//*****
}
}
else
masterpass++;//*****
if(masterpass<3)
{cout<<"Wrong password retry\n"<<endl;
goto mainscreen;
}
else
{
cout<<"bye bye\n"<<endl;
exit(0);//*****
}
}
else if(option==2)
{
string uname,upass;
userentry:
cout<<"enter username:\t";
cin>>uname;
cout<<"enter password:\t";
cin>>upass;
k=account-1;
if(k==-1)
{
cout<<"tell manager to create the account n then try to login\n"<<en
dl<<endl;
goto mainscreen;
}
for (k=0;k<account;k++)
{
if(uname==user[k]&&upass==pass[k])
{
cout<<"welcome user:\t"<<user[k]<<endl;
cout<<"Profile and Account Details Are:\n"<<endl;
cout<<"User Name:\t"<<user[k]<<endl<<
"Email Id:\t"<<email[k]<<endl<<
"Mobile Number:\t"<<mobile[k]<<endl<<
"Total Balance:\t"<<credit[k]<<endl<<
"Total Loan:\t"<<loan[k]<<endl;
flag=1;
goto mainscreen;
}
}
if (flag==0)
{
cout<<"wrong username/password\n"<<endl;//*****
goto userentry;
}

Vous aimerez peut-être aussi