Monday, 13 November 2017

Employee’s Management System Project in c++ with source

#include<iostream>

#include<cstring>

#include<cstdlib>

#include<iomanip>

#include<windows.h>

//#include <ctime>

//#include <dos.h>

#include<dos.h>

#include<conio.h>

#include<cstdio>

#define max 20

using namespace std;

struct employee

{

 char name[20];

 long int code;

 char designation[20];

 int exp;

 int age;

};

int num;

employee emp[max],tempemp[max],sortemp[max],sortemp1[max];

int main()

{

 system("cls");

 void build();

 void list();

 void insert();

 void deletes();

 void edit();

 void search();

 void sort();

 char option;

 void menu();

 menu();

 while((option=cin.get())!='q')

 {

  switch(option)

  {

   case 'b':

         build();

         break;

   case 'l':

         list();

         break;

   case 'i':

         insert();

         break;

   case 'd':

         deletes();

         break;

   case 'e':

       edit();

        break;

   case 's':

        search();

        break;

   case 'n':

         sort();

         break;

  }

   menu();

  }

  return 0;

 }

 void menu()

 {

  system("cls");

 // highvideo();

cout<<"          ";

printf("\n*****  Employees Management System 1.0 ***** ");



//normvideo();

cout<<endl;

cout<<"             ";

cout<<"\n\t\t Press  b---->Built The Employee Table ";

cout<<"             ";

cout<<"\n\t\t Press  l---->List The Employee Table  ";

cout<<"             ";

cout<<"\n\t\t Press  i---->Insert New Entry        ";

cout<<"             ";

cout<<"\n\t\t Press  d---->Delete An Entry         ";

cout<<"             ";

cout<<"\n\t\t Press  e---->Edit An Entry           ";

cout<<"             ";

cout<<"\n\t\t Press  s---->Search Arecord          ";

cout<<"             ";

cout<<"\n\t\t Press  n---->Sort The Table          ";

cout<<"             ";

cout<<"\n\t\t Press  q---------->Quit Program              ";

cout<<"             ";

cout<<"\n\n \t\t Select Your Option Please ====> ";

}


void build()

{


 system("cls");

// highvideo();

 printf("Build The Table");

 cout<<endl;

 //normvideo();

 cout<<"maximum number of entries  -----  >  20"<<endl;

 cout<<"how many do you want    ----->";

 cin>>num;

 cout<<"Enter The Following Items"<<endl;

 for(int i=0;i<=num-1;i++)

 {

  cout<<" Name  ";

  cin>>emp[i].name;

  cout<<"Code  ";

  cin>>emp[i].code;

  cout<<"Designation  ";

  cin>>emp[i].designation;

  cout<<"Years of Experience  ";

  cin>>emp[i].exp;

  cout<<"Age  ";

  cin>>emp[i].age;

 }

  cout<<"going to main menu";

 Sleep(500);

}


void  list()

{

 system("cls");

// highvideo();

 printf("       ********List The Table********");

 cout<<endl;

 //normvideo();

 cout<<"     Name     Code     Designation     Years(EXP)     Age "<<endl;

 cout<<"    ------------------------------------------------------"<<endl;

 for(int i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<emp[i].name;

  cout<<setw(6)<<emp[i].code;

  cout<<setw(15)<<emp[i].designation;

  cout<<setw(10)<<emp[i].exp;

  cout<<setw(15)<<emp[i].age;

  cout<<endl;

 }

  cout<<"going to main menu";

 getch();

  }

  void insert()

  {

  system("cls");

  int i=num;

  num+=1;

 // highvideo();

  printf("Insert New Record");

  cout<<endl;

  //normvideo();

  cout<<"Enter The Following Items"<<endl;

  cout<<"Name  ";

  cin>>emp[i].name;

  cout<<"Code  ";

  cin>>emp[i].code;

  cout<<"Designation  ";

  cin>>emp[i].designation;

  cout<<"Years of Experience  ";

  cin>>emp[i].exp;

  cout<<"Age  ";

  cin>>emp[i].age;

  cout<<endl<<endl;

  cout<<"going to main menu";

 Sleep(500);


  }



  void deletes()

  {

   system("cls");

  // highvideo();

   int code;

   int check;

   printf("Delete An Entry");

   //normvideo();

   cout<<endl;

   cout<<"Enter An JobCode To Delete That Entry  ";

   cin>>code;

   int i;

   for(i=0;i<=num-1;i++)

   {

    if(emp[i].code==code)

    {

      check=i;

    }

   }

   for(i=0;i<=num-1;i++)

   {

    if(i==check)

    {

    continue;

    }

    else

    {

    if(i>check)

    {

     tempemp[i-1]=emp[i];

    }

    else

    {

     tempemp[i]=emp[i];

    }

     }

   }

  num--;


  for(i=0;i<=num-1;i++)

  {

   emp[i]=tempemp[i];

  }

 }


void edit()

{

 system("cls");

 int jobcode;

// highvideo();

 printf("          Edit An Entry           ");

 cout<<endl;

 cout<<endl;

 int i;

 void editmenu();

 void editname(int);

 void editcode(int);

 void editdes(int);

 void editexp(int);

 void editage(int);

 char option;

 //normvideo();

 cout<<"Enter An jobcode To Edit An Entry----  ";

 cin>>jobcode;

  editmenu();

 for(i=0;i<=num-1;i++)

   {

    if(emp[i].code==jobcode)

    {


while((option=cin.get())!='q')

{

      switch(option)

      {

       case 'n':

            editname(i);

            break;

       case 'c':

            editcode(i);

            break;

       case 'd':

            editdes(i);

            break;

       case 'e':

            editexp(i);

            break;

       case 'a':

           editage(i);

           break;

     }

   editmenu();

    }

  }

  }

  }

  void editmenu()

  {

   system("cls");

   cout<<"        What Do You Want To edit";

   cout<<"          n--------->Name ";

   cout<<"          c--------->Code ";

   cout<<"          d--------->Designation";

   cout<<"          e--------->Experience ";

   cout<<"          a--------->Age        ";

   cout<<"              q----->QUIT                            ";

   cout<<"   Options Please ---->>>  ";

  }

  void editname(int i)

  {

     cout<<"Enter New Name----->  ";

     cin>>emp[i].name;

  }

  void editcode(int i)

  {

   cout<<"Enter New Job Code----->  ";

   cin>>emp[i].code;

  }

  void editdes(int i)

  {

   cout<<"enter new designation----->  ";

   cin>>emp[i].designation;

  }

  void editexp(int i)

  {

   cout<<"Enter new Years of Experience";

   cin>>emp[i].exp;

  }

  void editage(int i)

  {

   cout<<"Enter new Age ";

   cin>>emp[i].age;

  }


void search()

{

 system("cls");

 // highvideo();

  printf("Welcome To Search Of Employee Database ");

  //normvideo();

  cout<<endl;

  cout<<endl;

  int jobcode;

  cout<<"You Can Search Only By Jobcode Of An Employee";

  cout<<"Enter Code Of An Employee                    ";

 cin>>jobcode;

 for(int i=0;i<=num-1;i++)

   {

    if(emp[i].code==jobcode)

    {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

  cout<<setw(13)<<emp[i].name;

  cout<<setw(6)<<emp[i].code;

  cout<<setw(15)<<emp[i].designation;

  cout<<setw(10)<<emp[i].exp;

  cout<<setw(15)<<emp[i].age;

  cout<<endl;

 }


  }

    cout<<"going to main menu";

 getch();



}


void sort()

{

 system("cls");

// highvideo();

 printf("Sort The Databse By JobCode");

 //normvideo();

 void sortmenu();

 void sortname();

 void sortcode();

 void sortdes();

 void sortexp();

 char option;

 void sortage();


 cout<<endl;

 cout<<endl;

 sortmenu();

 while((option=cin.get())!='q')

 {

  switch(option)

  {

   case 'n':

          sortname();

          break;

   case 'c':

          sortcode();

          break;

   case 'd':

          sortdes();

          break;

   case 'e':

          sortexp();

          break;

   case 'a':

          sortage();

          break;

   }

   sortmenu();

  }

 }



 void sortmenu()

 {

    system("cls");

   cout<<"          What Do You Want To edit";

   cout<<"          n--------->Name         ";

   cout<<"          c--------->Code         ";

   cout<<"          d--------->Designation  ";

   cout<<"          e--------->Experience   ";

   cout<<"          a--------->Age          ";

   cout<<"                               q----->QUIT            ";

   cout<<"   Options Please ---->>>  ";  }




void sortname()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(strcmp(sortemp1[i].name,sortemp1[j].name)<=0)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }


void sortcode()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].code<sortemp1[j].code)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }



void sortdes()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(strcmp(sortemp1[i].designation,sortemp1[j].designation)<=0)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age";

 cout<<"     ------------------------------------------------------                                 ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }


void sortage()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].age<sortemp1[j].age)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age";

 cout<<"     ------------------------------------------------------                                 ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }



void sortexp()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].exp<sortemp1[j].exp)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"  ------------------------------------------------------ ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }











Bus Reservation System

#include <conio.h>

#include <cstdio>

#include <iostream>

#include <string.h>

#include <cstdlib>

using namespace std;

static int p = 0;

class a

{

  char busn[5], driver[10], arrival[5], depart[5], from[10], to[10], seat[8][4][10];

public:

  void install();

  void allotment();

  void empty();

  void show();

  void avail();

  void position(int i);

}

bus[10];

void vline(char ch)

{

  for (int i=80;i>0;i--)

  cout<<ch;

}

void a::install()

{

  cout<<"Enter bus no: ";

  cin>>bus[p].busn;

  cout<<"\nEnter Driver's name: ";

  cin>>bus[p].driver;

  cout<<"\nArrival time: ";

  cin>>bus[p].arrival;

  cout<<"\nDeparture: ";

  cin>>bus[p].depart;

  cout<<"\nFrom: \t\t\t";

  cin>>bus[p].from;

  cout<<"\nTo: \t\t\t";

  cin>>bus[p].to;

  bus[p].empty();

  p++;

}

void a::allotment()

{

  int seat;

  char number[5];

  top:

  cout<<"Bus no: ";

  cin>>number;

  int n;

  for(n=0;n<=p;n++)

  {

    if(strcmp(bus[n].busn, number)==0)

    break;

  }

  while(n<=p)

  {

    cout<<"\nSeat Number: ";

    cin>>seat;

    if(seat>32)

    {

      cout<<"\nThere are only 32 seats available in this bus.";

    }

    else

    {

    if (strcmp(bus[n].seat[seat/4][(seat%4)-1], "Empty")==0)

      {

        cout<<"Enter passanger's name: ";

        cin>>bus[n].seat[seat/4][(seat%4)-1];

        break;

      }

    else

      cout<<"The seat no. is already reserved.\n";

      }

      }

    if(n>p)

    {

      cout<<"Enter correct bus no.\n";

      goto top;

    }

  }


void a::empty()

{

  for(int i=0; i<8;i++)

  {

    for(int j=0;j<4;j++)

    {

      strcpy(bus[p].seat[i][j], "Empty");

    }

  }

}

void a::show()

{

  int n;

  char number[5];

  cout<<"Enter bus no: ";

  cin>>number;

  for(n=0;n<=p;n++)

  {

    if(strcmp(bus[n].busn, number)==0)

    break;

  }

while(n<=p)

{

  vline('*');

  cout<<"Bus no: \t"<<bus[n].busn

  <<"\nDriver: \t"<<bus[n].driver<<"\t\tArrival time: \t"

  <<bus[n].arrival<<"\tDeparture time:"<<bus[n].depart

  <<"\nFrom: \t\t"<<bus[n].from<<"\t\tTo: \t\t"<<

  bus[n].to<<"\n";

  vline('*');

  bus[0].position(n);

  int a=1;

  for (int i=0; i<8; i++)

  {

    for(int j=0;j<4;j++)

    {

      a++;

      if(strcmp(bus[n].seat[i][j],"Empty")!=0)

      cout<<"\nThe seat no "<<(a-1)<<" is reserved for "<<bus[n].seat[i][j]<<".";

    }

  }

  break;

  }

  if(n>p)

    cout<<"Enter correct bus no: ";

}

void a::position(int l)

{

  int s=0;p=0;

  for (int i =0; i<8;i++)

  {

    cout<<"\n";

    for (int j = 0;j<4; j++)

    {

      s++;

      if(strcmp(bus[l].seat[i][j], "Empty")==0)

        {

          cout.width(5);

          cout.fill(' ');

          cout<<s<<".";

          cout.width(10);

          cout.fill(' ');

          cout<<bus[l].seat[i][j];

          p++;

        }

        else

        {

        cout.width(5);

        cout.fill(' ');

        cout<<s<<".";

        cout.width(10);

        cout.fill(' ');

        cout<<bus[l].seat[i][j];

        }

      }

    }

  cout<<"\n\nThere are "<<p<<" seats empty in Bus No: "<<bus[l].busn;

  }

void a::avail()

{


  for(int n=0;n<p;n++)

  {

    vline('*');

    cout<<"Bus no: \t"<<bus[n].busn<<"\nDriver: \t"<<bus[n].driver

    <<"\t\tArrival time: \t"<<bus[n].arrival<<"\tDeparture Time: \t"

    <<bus[n].depart<<"\nFrom: \t\t"<<bus[n].from<<"\t\tTo: \t\t\t"

    <<bus[n].to<<"\n";

    vline('*');

    vline('_');

  }

}

int main()

{

system("cls");

int w;

while(1)

{

    //system("cls");

  cout<<"\n\n\n\n\n";

  cout<<"\t\t\t1.Install\n\t\t\t"

  <<"2.Reservation\n\t\t\t"

  <<"3.Show\n\t\t\t"

  <<"4.Buses Available. \n\t\t\t"

  <<"5.Exit";

  cout<<"\n\t\t\tEnter your choice:-> ";

  cin>>w;

  switch(w)

  {

    case 1:  bus[p].install();

      break;

    case 2:  bus[p].allotment();

      break;

    case 3:  bus[0].show();

      break;

    case 4:  bus[0].avail();

      break;

    case 5:  exit(0);

  }

}

return 0;

}









supermarket billing system in c++ source code download

//program for creating bill in a supermarket
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
using namespace std;
//global variable declaration
int k=7,r=0,flag=0;
COORD coord = {0, 0};

void gotoxy(int x, int y)
{
 COORD coord;
 coord.X = x;
 coord.Y = y;
 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
struct date
{int mm,dd,yy;};

ofstream fout;
ifstream fin;

class item
{
int itemno;
char name[25];
date d;
public:
void add()
{
cout<<"\n\n\tItem No: ";
cin>>itemno;
cout<<"\n\n\tName of the item: ";
cin>>name;
//gets(name);
cout<<"\n\n\tManufacturing Date(dd-mm-yy): ";
cin>>d.mm>>d.dd>>d.yy;
}
void show()
{
cout<<"\n\tItem No: ";
cout<<itemno;
cout<<"\n\n\tName of the item: ";
cout<<name;
cout<<"\n\n\tDate : ";
cout<<d.mm<<"-"<<d.dd<<"-"<<d.yy;
}
void report()
{
gotoxy(3,k);
cout<<itemno;
gotoxy(13,k);
puts(name);
}
int retno()
{
    return(itemno);

}

};

class amount: public item
{
float price,qty,tax,gross,dis,netamt;
public:
void add();
void show();
void report();
void calculate();
void pay();
float retnetamt()
{
    return(netamt);
}
}amt;

void amount::add()
{
item::add();
cout<<"\n\n\tPrice: ";
cin>>price;
cout<<"\n\n\tQuantity: ";
cin>>qty;
cout<<"\n\n\tTax percent: ";
cin>>tax;
cout<<"\n\n\tDiscount percent: ";
cin>>dis;
calculate();
fout.write((char *)&amt,sizeof(amt));
fout.close();
}
void amount::calculate()
{gross=price+(price*(tax/100));
netamt=qty*(gross-(gross*(dis/100)));
}
void amount::show()
{fin.open("itemstore.dat",ios::binary);
fin.read((char*)&amt,sizeof(amt));
item::show();
cout<<"\n\n\tNet amount: ";
cout<<netamt;
fin.close();
}

void amount::report()
{item::report();
gotoxy(23,k);
cout<<price;
gotoxy(33,k);
cout<<qty;
gotoxy(44,k);
cout<<tax;
gotoxy(52,k);
cout<<dis;
gotoxy(64,k);
cout<<netamt;
k=k+1;
if(k==50)
{gotoxy(25,50);
cout<<"PRESS ANY KEY TO CONTINUE...";
getch();
k=7;
system("cls");
gotoxy(30,3);
cout<<" ITEM DETAILS ";
gotoxy(3,5);
cout<<"NUMBER";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX";
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(64,5);
cout<<"NET AMOUNT";
}
}

void amount::pay()
{show();
cout<<"\n\n\n\t\t*********************************************";
cout<<"\n\t\t                 DETAILS                  ";
cout<<"\n\t\t*********************************************";
cout<<"\n\n\t\tPRICE                     :"<<price;
cout<<"\n\n\t\tQUANTITY                  :"<<qty;
cout<<"\n\t\tTAX PERCENTAGE              :"<<tax;
cout<<"\n\t\tDISCOUNT PERCENTAGE         :"<<dis;
cout<<"\n\n\n\t\tNET AMOUNT              :Rs."<<netamt;
cout<<"\n\t\t*********************************************";
}

int main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout<<setprecision(2);
fstream tmp("temp.dat",ios::binary|ios::out);
menu:
system("cls");
gotoxy(25,2);
cout<<"Super Market Billing ";
gotoxy(25,3);
cout<<"===========================\n\n";
cout<<"\n\t\t1.Bill Report\n\n";
cout<<"\t\t2.Add/Remove/Edit Item\n\n";
cout<<"\t\t3.Show Item Details\n\n";
cout<<"\t\t4.Exit\n\n";
cout<<"\t\tPlease Enter Required Option: ";
int ch,ff;
float gtotal;
cin>>ch;
switch(ch)
{case 1:ss:
system("cls");
gotoxy(25,2);
cout<<"Bill Details";
gotoxy(25,3);
cout<<"================\n\n";
cout<<"\n\t\t1.All Items\n\n";
cout<<"\t\t2.Back to Main menu\n\n";
cout<<"\t\tPlease Enter Required Option: ";
int cho;
cin>>cho;
if(cho==1)
{system("cls");
gotoxy(30,3);
cout<<" BILL DETAILS ";
gotoxy(3,5);
cout<<"ITEM NO";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX %";
gotoxy(52,5);
cout<<"DISCOUNT %";
gotoxy(64,5);
cout<<"NET AMOUNT";
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;}
fin.seekg(0);
gtotal=0;
while(!fin.eof())
{fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{amt.report();
gtotal+=amt.retnetamt();
ff=0;}
if(ff!=0) gtotal=0;
}gotoxy(17,k);
cout<<"\n\n\n\t\t\tGrand Total="<<gtotal;
getch();
fin.close();
}
if(cho==2)
{goto menu;}
goto ss;
case 2:
db:
system("cls");
gotoxy(25,2);
cout<<"Bill Editor";
gotoxy(25,3);
cout<<"=================\n\n";
cout<<"\n\t\t1.Add Item Details\n\n";
cout<<"\t\t2.Edit Item Details\n\n";
cout<<"\t\t3.Delete Item Details\n\n";
cout<<"\t\t4.Back to Main Menu ";
int apc;
cin>>apc;
switch(apc)
{
case 1:fout.open("itemstore.dat",ios::binary|ios::app);
amt.add();
cout<<"\n\t\tItem Added Successfully!";
getch();
goto db;

case 2:
int ino;
flag=0;
cout<<"\n\n\tEnter Item Number to be Edited :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
fout.open("itemstore.dat",ios::binary|ios::app);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;
}
fin.seekg(0);
r=0;
while(!fin.eof())
{fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{int x=amt.item::retno();
if(x==ino)
{flag=1;
fout.seekp(r*sizeof(amt));
system("cls");
cout<<"\n\t\tCurrent Details are\n";
amt.show();
cout<<"\n\n\t\tEnter New Details\n";
amt.add();
cout<<"\n\t\tItem Details editted";
}
}r++;
}
if(flag==0)
{cout<<"\n\t\tItem No does not exist...Please Retry!";
getch();
goto db;
}
fin.close();
getch();
goto db;

case 3:flag=0;
cout<<"\n\n\tEnter Item Number to be deleted :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;
}
//fstream tmp("temp.dat",ios::binary|ios::out);
fin.seekg(0);
while(fin.read((char*)&amt, sizeof(amt)))
{int x=amt.item::retno();
if(x!=ino)
tmp.write((char*)&amt,sizeof(amt));
else
{flag=1;}
}
fin.close();
tmp.close();
fout.open("itemstore.dat",ios::trunc|ios::binary);
fout.seekp(0);
tmp.open("temp.dat",ios::binary|ios::in);
if(!tmp)
{cout<<"Error in File";
goto db;
}
while(tmp.read((char*)&amt,sizeof(amt)))
fout.write((char*)&amt,sizeof(amt));
tmp.close();
fout.close();
if(flag==1)
cout<<"\n\t\tItem Succesfully Deleted";
else if (flag==0)
cout<<"\n\t\tItem does not Exist! Please Retry";
getch();
goto db;
case 4:
goto menu;
default: cout<<"\n\n\t\tWrong Choice!!! Retry";
getch();
goto db;
}
case 3:system("cls");
flag=0;
int ino;
cout<<"\n\n\t\tEnter Item Number :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...\nProgram Terminated!";
goto menu;
}
fin.seekg(0);
while(fin.read((char*)&amt,sizeof(amt)))
{int x=amt.item::retno();
if(x==ino)
{amt.pay();
flag=1;
break;
}
}
if(flag==0)
cout<<"\n\t\tItem does not exist....Please Retry!";
getch();
fin.close();
goto menu;
case 4:system("cls");
gotoxy(20,20);
cout<<"ARE YOU SURE, YOU WANT TO EXIT (Y/N)?";
char yn;
cin>>yn;
if((yn=='Y')||(yn=='y'))
{gotoxy(12,20);
system("cls");
cout<<"************************** THANKS **************************************";
getch();
exit(0);
}
else if((yn=='N')||(yn=='n'))
goto menu;
else{goto menu;}
default:cout<<"\n\n\t\tWrong Choice....Please Retry!";
getch();
goto menu;
}
return 0;
}






school fee enquiry management system in c++ source code download

//PROJECT SCHOOL FEE ENQUIRY
#include <iostream>
#include <windows.h>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <conio.h>
#include <ctime>
#include <dos.h>
#include <iomanip>
using namespace std;
int i,j,li,lp,rec,valid;
COORD coord = {0, 0};
void gotoxy(int x, int y)
{
 COORD coord;
 coord.X = x;
 coord.Y = y;
 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void help();
//**************************** **********
//  GLOBAL VARIABLE DECLARATIONS
//**************************** **********

//int i,j,li,lp;
char ch,choice;

//**************************** ********
// THIS CLASS DRAWS LINES, BOXES, ETC.
//**************************** ********

class DRAW
{
 public :
 void LINE_HOR(int, int, int, char) ;
 void LINE_VER(int, int, int, char) ;
 void BOX(int,int,int,int,char) ;
} ;

//**********************************************************
// THIS CLASS CONTROLS ALL THE FUNCTIONS RELATED TO FEES
//**********************************************************

class FEE
{
 private :
 int  Class ;
 float tuition, ac, science, computer, activity ;
 void DISPLAY(int) ;
 void MODIFY_RECORD(int, float, float, float, float, float) ;

 public :
 void ADDITION(void) ;
 void MODIFICATION(void) ;
 void FEE_SLIP(void) ;
 void LIST(void) ;
 void HELP(void);
}fee ;

//****************************************
//                  MAIN MENU FUNCTION
//****************************************
void mainmenu()
{
 system("cls");

 for(li=30;li<=50;li++)
 {

 gotoxy(li,14);
 Sleep(30);
 printf("*");
 }
 for(li=50;li>=30;li--)
 {

 gotoxy(li,30);
 Sleep(30);
 printf("*");
 }
 for(lp=15;lp<30;lp++)
 {
 gotoxy(30,lp);
 Sleep(100);
 printf("|");
 }
 for(lp=29;lp>=15;lp--)
 {
 gotoxy(50,lp);
 Sleep(100);
 printf("|");
 }
 gotoxy(15,10);

 printf("Press the corresponding Keys for the desired action");
 gotoxy(35,16);

 printf("F: FEE SLIP");
 gotoxy(35,19);

 printf("M: MODIFY");
 gotoxy(35,22);

 printf("L: LIST");
 gotoxy(35,25);

 printf("H: HELP");
 gotoxy(35,28);

 printf("Q: QUIT");
 choice=getch();
 ch=toupper(choice);
 switch(ch)
 {
 case'F':fee.FEE_SLIP();
 break;
 case'M':fee.MODIFICATION();
 break;
 case'L':fee.LIST();
 break;
 case'H':fee.HELP();
 break;
 case'Q':exit(0);
 break;
 default:gotoxy(33,40);
 cout<<"Illegal Choice Press any key to return to Main Menu";
 getch();
 mainmenu();
 }
}
//Main Menu Function End

//************************************
// FUNCTION TO DRAW HORIZONTAL LINE
//************************************

void DRAW :: LINE_HOR(int column1, int column2, int row, char c)
{
 for ( column1; column1<=column2; column1++ )
 {
 gotoxy(column1,row) ;
 cout <<c ;
 }
}

//**********************************************************
// FUNCTION TO DRAW VERTICAL LINE
//**********************************************************

void DRAW :: LINE_VER(int row1, int row2, int column, char c)
{
 for ( row1; row1<=row2; row1++ )
 {
 gotoxy(column,row1) ;
 cout <<c ;
 }
}

//**********************************************************
// FUNCTION TO DRAW BOX LINE
//**********************************************************

void DRAW :: BOX(int column1, int row1, int column2, int row2, char c)
{
 char ch=218 ;
 char c1, c2, c3, c4 ;
 char l1=196, l2=179 ;
 if (c == ch)
 {
 c1=218 ;
 c2=191 ;
 c3=192 ;
 c4=217 ;
 l1 = 196 ;
 l2 = 179 ;
 }
 else
 {
 c1=c ;
 c2=c ;
 c3=c ;
 c4=c ;
 l1 = c ;
 l2 = c ;
 }
 gotoxy(column1,row1) ;
 cout <<c1 ;
 gotoxy(column2,row1) ;
 cout <<c2 ;
 gotoxy(column1,row2) ;
 cout <<c3 ;
 gotoxy(column2,row2) ;
 cout <<c4 ;
 column1++ ;
 column2-- ;
 LINE_HOR(column1,column2,row1,l1) ;
 LINE_HOR(column1,column2,row2,l1) ;
 column1-- ;
 column2++ ;
 row1++ ;
 row2-- ;
 LINE_VER(row1,row2,column1,l2) ;
 LINE_VER(row1,row2,column2,l2) ;
}

//**********************************************************
// FUNCTION TO ADD FEE STRUCTURE IN FEE FILE
//**********************************************************

void FEE :: ADDITION(void)
{
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 if (!file.fail())
 return ;
 file.close() ;
 file.open("FEE.DAT", ios::app) ;
 for (int i=1; i<=12; i++)
 {
 Class   = i ;
 tuition  = 0.0 ;
 ac      = 0.0 ;
 science = 0.0 ;
 computer= 0.0 ;
 activity= 0.0 ;
 file.write((char *) this, sizeof(FEE)) ;
 }
 file.close() ;
 MODIFY_RECORD(12,450,50,60,60,50) ;
 MODIFY_RECORD(11,450,50,60,60,50) ;
 MODIFY_RECORD(10,350,50,30,60,50) ;
 MODIFY_RECORD(9,350,50,20,60,50) ;
 MODIFY_RECORD(8,300,50,20,40,50) ;
 MODIFY_RECORD(7,300,50,20,40,50) ;
 MODIFY_RECORD(6,300,50,20,40,50) ;
 MODIFY_RECORD(5,250,50,0,40,40) ;
 MODIFY_RECORD(4,250,50,0,40,40) ;
 MODIFY_RECORD(3,250,50,0,40,40) ;
 MODIFY_RECORD(2,250,50,0,40,40) ;
 MODIFY_RECORD(1,250,50,0,40,40) ;
}

//**********************************************************
// FUNCTION TO DISPLAY TOTAL FEE AS LIST
//**********************************************************

void FEE :: LIST()
{
 system("cls") ;
 DRAW d ;
// textcolor(MAGENTA);
 d.BOX(1,2,80,24,218) ;
 gotoxy(27,3) ;
 cout <<"TOTAL FEES FOR THE CLASSES" ;
 d.LINE_HOR(2,79,4,196) ;
 gotoxy(5,5) ;
 cout <<"CLASS             TOTAL FEES" ;
 d.LINE_HOR(2,79,6,196) ;
 d.LINE_HOR(2,79,22,196) ;
 float total ;
 int row=8 ;
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 while (file.read((char *) this, sizeof(FEE)))
 {
 total = tuition + ac + science + computer + activity ;
 gotoxy(6,row) ;
 cout <<Class ;
 gotoxy(23,row) ;
 cout <<total ;
 row++ ;
 }
 file.close() ;
 gotoxy(5,23) ;
 cout <<"Press any key to continue............." ;
 getch() ;
 mainmenu();
}

//**********************************************************
// FUNCTION TO DISPLAY THE RECORD FOR THE GIVEN CLASS
//**********************************************************

void FEE :: DISPLAY(int tclass)
{
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 while (file.read((char *) this, sizeof(FEE)))
 {
 if (Class == tclass)
 {
 gotoxy(5,5) ;
 cout <<"Class : " <<Class ;
 gotoxy(5,7) ;
 cout <<"~~~~~~~~~~~~" ;
 gotoxy(5,8) ;
 cout <<"Tution Fee  : " <<tuition ;
 gotoxy(5,9) ;
 cout <<"Annual charges Fee  : " <<ac ;
 gotoxy(5,10) ;
 cout <<"Science Fee : " <<science ;
 gotoxy(5,11) ;
 cout <<"Computer Fee: " <<computer ;
 gotoxy(5,12) ;
 cout <<"Activity Fee : " <<activity ;
 break ;
 }
 }
 file.close() ;
}

//**********************************************************
// FUNCTION TO MODIFY THE FEE RECORD FOR THE GIVEN DATA
//**********************************************************

void FEE :: MODIFY_RECORD(int tclass, float ttution, float tac, float
tscience, float tcomputer, float tactivity)
{
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 fstream temp ;
 temp.open("temp.dat", ios::out) ;
 file.seekg(0,ios::beg) ;
 while (!file.eof())
 {
 file.read((char *) this, sizeof(FEE)) ;
 if (file.eof())
 break ;
 if (tclass == Class)
 {
 Class   = tclass ;
 tuition  = ttution ;
 ac      = tac ;
 science = tscience ;
 computer= tcomputer ;
 activity= tactivity ;
 temp.write((char *) this, sizeof(FEE)) ;
 }
 else
 temp.write((char *) this, sizeof(FEE)) ;
 }
 file.close() ;
 temp.close() ;
 file.open("FEE.DAT", ios::out) ;
 temp.open("temp.dat", ios::in) ;
 temp.seekg(0,ios::beg) ;
 while (!temp.eof())
 {
 temp.read((char *) this, sizeof(FEE)) ;
 if (temp.eof())
 break ;
 file.write((char *) this, sizeof(FEE)) ;
 }
 file.close() ;
 temp.close() ;
}

//**********************************************************
// FUNCTION TO GIVE DATA TO MODIFY THE FEE RECORD
//**********************************************************

void FEE :: MODIFICATION(void)
{
 system("cls") ;
 char  ch, t1[10] ;
 int   valid=0, t=0, tclass=0 ;
 float t2=0 ;
 do
 {
 valid = 1 ;
 gotoxy(5,25) ;
 cout <<"Press <ENTER> for EXIT" ;
 gotoxy(5,5) ;
 cout <<"Enter Class for the Modification of the Fee Structure : " ;
 gets(t1) ;
 t = atoi(t1) ;
 tclass = t ;
 if (strlen(t1) == 0)
 return ;
 if (tclass < 1 || tclass > 12)
 {
 valid = 0 ;
 gotoxy(5,25) ;
 cout <<"Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 system("cls") ;
 gotoxy(71,1) ;
 cout <<"<0>=Exit" ;
 DISPLAY(tclass) ;
 gotoxy(5,25) ;
 do
 {
 gotoxy(5,15) ;
 cout <<"Do you want to modify the fee structure (y/n) : " ;
 ch = getche() ;
 if (ch == '0')
 return ;
 ch = toupper(ch) ;
 } while (ch != 'N' && ch != 'Y') ;
 if (ch == 'N')
 mainmenu();
 float ttution=0.0, tac=0.0, tscience=0.0, tcomputer=0.0, tactivity=0.0
;
 gotoxy(5,13) ;
 gotoxy(5,17) ;
 cout <<"Tuition Fee : " ;
 gotoxy(5,18) ;
 cout <<"Annual Charges Fee : " ;
 gotoxy(5,19) ;
 cout <<"Science Fee : " ;
 gotoxy(5,20) ;
 cout <<"Computer Fee : " ;
 gotoxy(5,21) ;
 cout <<"Activity Fee : " ;
 int modified = 5 ;
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 while (file.read((char *) this, sizeof(FEE)))
 if (Class == tclass)
 break ;
 file.close() ;
 do
 {
 valid = 1 ;
 gotoxy(5,27) ;
 cout <<"Enter TUITION FEE or Press <ENTER> for no change" ;
 gotoxy(19,17) ;
 gets(t1) ;
 t2 = atof(t1) ;
 ttution = t2 ;
 if (t1[0] == '0')
 return;
 if (strlen(t1) == 0)
 break ;
 if (ttution > 1000)
 {
 valid = 0 ;
 gotoxy(5,27) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 if (strlen(t1) == 0)
 {
 modified-- ;
 ttution = tuition ;
 gotoxy(20,17) ;
 cout <<ttution ;
 }
 do
 {
 valid = 1 ;
 gotoxy(5,27) ;
 cout <<"Enter ANNUAL CHARGES fee or Press <ENTER> for no change" ;
 gotoxy(26,18) ;
 gets(t1) ;
 t2 = atof(t1) ;
 tac = t2 ;
 if (t1[0] == '0')
 return ;
 if (strlen(t1) == 0)
 break ;
 if (tac > 1000)
 {
 valid = 0 ;
 gotoxy(5,27) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 if (strlen(t1) == 0)
 {
 modified-- ;
 tac = ac ;
 gotoxy(26,18) ;
 cout <<tac ;
 }
 do
 {
 valid = 1 ;
 gotoxy(5,27) ;
 cout <<"Enter SCIENCE FEES or Press <ENTER> for no change" ;
 gotoxy(19,19) ;
 gets(t1) ;
 t2 = atof(t1) ;
 tscience = t2 ;
 if (t1[0] == '0')
 return ;
 if (strlen(t1) == 0)
 break ;
 if (tscience > 1000)
 {
 valid = 0 ;
 gotoxy(5,27) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 if (strlen(t1) == 0)
 {
 modified-- ;
 tscience = science ;
 gotoxy(19,19) ;
 cout <<tscience ;
 }
 do
 {
 valid = 1 ;
 gotoxy(5,27) ;
 cout <<"Enter COMPUTER FEES or Press <ENTER> for no change" ;
 gotoxy(19,20) ;
 gets(t1) ;
 t2 = atof(t1) ;
 tcomputer = t2 ;
 if (t1[0] == '0')
 return ;
 if (strlen(t1) == 0)
 break ;
 if (tcomputer > 1000)
 {
 valid = 0 ;
 gotoxy(5,27) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 if (strlen(t1) == 0)
 {
 modified-- ;
 tcomputer = computer ;
 gotoxy(19,20) ;
 cout <<tcomputer ;
 }
 do
 {
 valid = 1 ;
 gotoxy(5,27) ;
 cout <<"Enter ACTIVITY FEES or Press <ENTER> for no change" ;
 gotoxy(19,21) ;
 gets(t1) ;
 t2 = atof(t1) ;
 tactivity = t2 ;
 if (t1[0] == '0')
 return;
 if (strlen(t1) == 0)
 break;
 if (tactivity > 1000)
 {
 valid = 0 ;
 gotoxy(5,27) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 if (strlen(t1) == 0)
 {
 modified-- ;
 tactivity = activity ;
 gotoxy(19,21) ;
 cout <<tactivity ;
 }
 if (!modified)
 mainmenu();
 gotoxy(5,27) ;
 do
 {
 gotoxy(5,25) ;
 cout <<"Do you want to save (y/n) : " ;
 ch = getche() ;
 if (ch == '0')
 return ;
 ch = toupper(ch) ;
 } while (ch != 'N' && ch != 'Y') ;
 if (ch == 'N')
 return ;
 MODIFY_RECORD(tclass,ttution,tac,tscience,tcomputer,tactivity);
 gotoxy(5,27) ;
 cout <<"7Record Modified" ;
 gotoxy(5,29) ;
 cout <<"Press any key to continue..........." ;
 getch() ;
 mainmenu();
}

//**********************************************************
// FUNCTION TO DISPLAY THE FEE SLIP FOR THE CLASS
//**********************************************************

void FEE :: FEE_SLIP(void)
{
 system("cls") ;

 char  ch, t1[10] ;
 int   valid=0, t=0, tclass=0 ;
 do
 {
 valid = 1 ;
 gotoxy(5,25) ;
 cout <<"Press <ENTER> for EXIT" ;
 gotoxy(5,5) ;
 cout <<"Enter Class to see the Fee Structure : " ;
 gets(t1) ;
 t = atoi(t1) ;
 tclass = t ;
 if (strlen(t1) == 0)
 return ;
 if (tclass < 1 || tclass > 12)
 {
 valid = 0 ;
 gotoxy(5,25) ;
 cout <<"7Enter correctly" ;
 getch() ;
 }
 } while (!valid) ;
 char name[26] ;
 do
 {
 gotoxy(5,25) ;
 cout <<"ENTER NAME OF THE STUDENT" ;
 valid = 1 ;
 gotoxy(5,7) ;
 cout <<"Name : " ;
 gets(name) ;
 if (strlen(name) < 1 || strlen(name) > 25)
 {
 valid = 0 ;
 gotoxy(5,25) ;
 cout <<"NAME SHOULD NOT BE GREATER THAN 25" ;
 getch() ;
 }
 } while (!valid) ;
 system("cls") ;
 DRAW d ;
 d.BOX(20,2,61,24,987) ;
 gotoxy(24,3) ;
 cout <<"         YOUR SCHOOL      " ;
 int d1, m1, y1 ;
 time_t td = time(0);
 struct tm * now = localtime( & td );
 d1 = now->tm_mday ;
 m1 = (now->tm_mon +1 ) ;
 y1 = (now->tm_year +1900 );
 gotoxy(45,4) ;
 cout <<"Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ;
 d.LINE_HOR(21,60,5,196) ;
 gotoxy(22,6) ;
 cout <<"NAME  : " <<name ;
 gotoxy(22,7) ;
 cout <<"CLASS : " <<tclass ;
 d.LINE_HOR(21,60,8,196) ;
 gotoxy(21,9) ;
 cout <<"    PARTICULARS               AMOUNT" ;
 d.LINE_HOR(21,60,10,196) ;
 d.LINE_HOR(21,60,22,196) ;
 d.LINE_HOR(46,60,20,196) ;
 gotoxy(25,21) ;
 cout <<"TOTAL" ;
 gotoxy(54,23) ;
 cout <<"CASHIER" ;
 fstream file ;
 file.open("FEE.DAT", ios::in) ;
 while (!file.eof())
{
 file.read((char *) this, sizeof(FEE));
 if (Class == tclass)
 {
 cout<<"found"<<endl;
 break ;
 }
 file.close() ;
}
 float total=0.0 ;
 gotoxy(23,12) ;
 cout <<"Tuition fees               " <<setprecision(2) <<tuition ;
 total = total+tuition ;
 gotoxy(23,13) ;
 cout <<"Annual charges fees       " <<setprecision(2) <<ac ;
 total = total+ac ;
 gotoxy(23,14) ;
 cout <<"Science fees              " <<setprecision(2) <<science ;
 total = total+science ;
 gotoxy(23,15) ;
 cout <<"Computer fees             " <<setprecision(2) <<computer ;
 total = total+computer ;
 gotoxy(23,16) ;
 cout <<"Activity fees             " <<setprecision(2) <<activity ;
 total = total+activity ;
 d.LINE_VER(9,21,46,179) ;
 char tt[15] ;
 sprintf(tt,"%f",total) ;
 gotoxy(49,21) ;
 cout <<tt ;
 gotoxy(33,40);
 cout<<"Press any key to return to the main menu........";
 getch() ;
 mainmenu();
}

void FEE::HELP()
{
 system("cls");

 cout<<"This is a fee structure program"<<endl;
 cout<<"It can be used to :  "<<endl;
 cout<<"1. View the fee slip of a student of a class"<<endl;
 cout<<"2. Modify the fee structure of the school"<<endl;
 cout<<"3. View the fee structure of the school in the form of alist"<<endl;
 cout<<"The menu functions are described as follows"<<endl;
 cout<<"1. FEE SLIP:  This function displays the fee slip for a givenstudent"<<endl;
 cout<<" from the class entered by the user. "<<endl;
 cout<<"2. MODIFY:    This function modifies the fee structure for a give class."<<endl;
 cout<<" The user can change the fees for various fields"<<endl;
 cout<<"3. LIST:      This function displays the list of total fees for all the"<<endl;
 cout<<"Press any key to continue..........."<<endl;
 getch();
 mainmenu();
}

//**********************************************************
// MAIN FUNCTION TO CREATE MENU AND CALL OTHER FUNCTIONS
//**********************************************************

int main()
{
 FEE fee;
 fee.ADDITION();
 system("cls");

 for(i=10;i<71;i++)
 {
 gotoxy(i,15);
 Sleep(30);
 printf("/");
 }
 for(i=70;i>=10;i--)
 {
 gotoxy(i,22);
 Sleep(30);
 cout<<" / ";
 }
 for(j=16;j<=21;j++)
 {
 gotoxy(10,j);
 Sleep(100);
 printf("-");
 }
 for(j=21;j>=16;j--)
 {
 gotoxy(70,j);
 Sleep(100);
 printf("-");
 }
 gotoxy(16,17);
 printf("Fee Structure System");
 gotoxy(12,20);
 printf("  coding Project and Syntax ");
 printf("Press Any Key To ..........Continue");
 getch();
 mainmenu();

 return 0;
}







Hang Man in C++ source code download

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <cstring>

using namespace std;

inline void type_of_word(char f);


int main()
{   char c,h,ch,ch1,ch2;
    char word[25];
    char word2[25];

    int l,i,ng,n,k,x;

do{
    do{
        c='\0';
        cout<<"\n\t\t    *********** HANGMAN IN C++ ***********\n\n";

        cout<<"(E) Enter a word\n\n(C) Computer chooses word\n\n(A)" ;
        cout<<"Add new word to list\n\n(Q) Quit\n\n\nEnter your choice (E - C - Q): ";
        cin>>ch2;
       }while (ch2!='C' && ch2!='c' && ch2!='E' && ch2!= 'e' &&
                ch2!='Q' && ch2!= 'q'&& ch2!='A' && ch2!= 'a');
    if (ch2 == 'Q' || ch2=='q')  exit (0);

    if (ch2 == 'C' || ch2=='c')

    {
        ifstream fin("hangword.txt");
        if(!fin) {
        cout<<"File missing, aborting.\n\nYou are missing a file of name" ;
        cout<<"**hangword.txt**\n\nLocate it, then place it next to the" "program file.\n\n";
system("pause");
return 0;
}
        for (i=0;!fin.eof();i++)   fin.getline(word,25);
        fin.close();

        do {
        x=rand();
        }while(x>i || x<0);

        ifstream finn("hangword.txt");
        for (i=0;!finn.eof();i++)
        {finn>>c; finn.getline(word,25); if (x==i) break;}
        finn.close();
    }

  if (ch2 == 'A' || ch2=='a')

    {
        ofstream fout("hangword.txt",ios::app);
        if(!fout) {//clrscr();
        cout<<"File missing, aborting.\n\nYou are missing a file of name"
        " **hangword.txt**\n\nLocate it, then place it next to the program"
        " file.\n\n"; system("pause"); return 0;}
        cin.get();
        cout<<"Choose the topic of your word\n\n(M) Movie\n\n(A) Animal\n\n(P)"
        " Sport\n\n(S) Song\n\nEnter your choice (A-P-S-M) : ";
        cin>>h;
        cin.get();
        //clrscr();
        cout<<"\n\nThe word should not exceed 25 letters\n\nEnter the word : ";
        cin.getline(word,25);
        fout<<h<<word<<endl;
        fout.close();

    }


   if (ch2 == 'E' || ch2=='e')
     {// clrscr();
       cin.get();
       cout<<"\t\t\t Type the word :  ";
       cin.getline (word, 25);
     }
 if (ch2 == 'E' || ch2=='e' || ch2 == 'C' || ch2=='c')
{
l=strlen(word);
char choosen[25]="\0";
n=0;k=0;

 for(i=0;i<=24;i++)
   {
    if (word[i]=='\0') {word2[i]='\0';break;}
    if (word[i]==' ')  {word2[i]=' ';  n++;}
    if (word[i]!=' ')  word2[i]='-';
   }
ng=l+2-n;     //only 2 guesses extra
   do{
   there:  type_of_word(c);
     if (k!=0)  cout<<"\n\n\t\t\tChoosen letters : "<<choosen<<"\n";
     cout<<"\n\n\n\t\t\t      "<<word2<<"\n\n\nYou have "<<ng
     << " guesses left, choose a letter : ";
     cin>>ch; cin.get();
     for (i=0;i<25;i++) if (choosen[i]==ch) {//clrscr();
     cout<<"\a\t\t     !!You have choosen "<<ch<<" already!!\n";goto there;}
     ng--; choosen [k]=ch; choosen [k+1]=',';k+=2;

     for (i=0;i<=24;i++)   
     if (word[i]==ch || word[i]==ch+32 || word[i]==ch-32) word2[i]=ch;
     if (!strcmpi (word2,word)) {cout<<"\n\t\t\t      "<<strupr(word)
     <<"\n\n\t\t\tCongratulations  :-()\n"; break;}

    }while(ng>0 || !strcmpi (word2,word));


if (strcmpi (word2,word))  cout<<"\nSorry, maybe next time.\n\nThe word was : "
<<strupr(word)<<endl;
}

cout<<"\nWould you like to play again??? (Y - N) : ";
cin>>ch1;  cin.get();

}while (ch1=='y' || ch1=='Y');
      system("PAUSE");
      return 0;
}

inline void type_of_word(char f)

{    if (f=='m') cout<<"\t\t\t\tMOVIE";
     if (f=='a') cout<<"\t\t\t\tANIMAL";
     if (f=='p') cout<<"\t\t\t\tSPORT";
     if (f=='s') cout<<"\t\t\t\tSONG";
}

// End of Code






Student database system

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <conio.h>
#include <iomanip>

using namespace std;
int main() {
    FILE *fp, *ft;
    char another, choice;

struct student {
        char first_name[50], last_name[50];
        char course[100];
        int section;
    };

    struct student e;
    char xfirst_name[50], xlast_name[50];
    long int recsize;

    fp=fopen("users.txt","rb+");

    if (fp == NULL) {
        fp = fopen("users.txt","wb+");

        if (fp==NULL)
        {
             puts("Cannot open file");
             return 0;
        }
    }


 recsize = sizeof(e);

 while(1) {
     system("cls");

     cout << "\t\t====== STUDENT INFORMATION SYSTEM ======";
     cout <<"\n\n                                          ";
     cout << "\n\n";
     cout << "\n \t\t\t 1. Add    Records";
     cout << "\n \t\t\t 2. List   Records";
     cout << "\n \t\t\t 3. Modify Records";
     cout << "\n \t\t\t 4. Delete Records";
     cout << "\n \t\t\t 5. Exit   Program";
     cout << "\n\n";
     cout << "\t\t\t Select Your Choice :=> ";
     fflush(stdin);
     choice = getche();
     switch(choice)
     {
      case '1' :
            fseek(fp,0,SEEK_END);
            another ='Y';
            while(another == 'Y' || another == 'y')
            {
                  system("cls");
                cout << "Enter the Firt Name : ";
                cin >> e.first_name;
                cout << "Enter the Last Name : ";
                cin >> e.last_name;
                cout << "Enter the Course    : ";
                cin >> e.course;
                cout << "Enter the Section   : ";
                cin >> e.section;
                fwrite(&e,recsize,1,fp);
                cout << "\n Add Another Record (Y/N) ";
                fflush(stdin);
                another = getchar();
            }
            break;
   case '2':
            system("cls");
           rewind(fp);
           cout << "=== View the Records in the Database ===";
           cout << "\n";
           while (fread(&e,recsize,1,fp) == 1){
           cout << "\n";
           cout <<"\n" << e.first_name << setw(10)  << e.last_name;
           cout << "\n";
           cout <<"\n" <<e.course <<  setw(8)  << e.section;
           }
           cout << "\n\n";
           system("pause");
           break;

   case '3' :
            system("cls");
          another = 'Y';
          while (another == 'Y'|| another == 'y')
          {
              cout << "\n Enter the last name of the student : ";
              cin >> xlast_name;

            rewind(fp);
            while (fread(&e,recsize,1,fp) == 1)
            {
                if (strcmp(e.last_name,xlast_name) == 0)
                {
                cout << "Enter new the Firt Name : ";
                cin >> e.first_name;
                cout << "Enter new the Last Name : ";
                cin >> e.last_name;
                cout << "Enter new the Course    : ";
                cin >> e.course;
                cout << "Enter new the Section   : ";
                cin >> e.section;
                fseek(fp, - recsize, SEEK_CUR);
                fwrite(&e,recsize,1,fp);
                break;
                }
                else
                cout<<"record not found";
            }
            cout << "\n Modify Another Record (Y/N) ";
                fflush(stdin);
                another = getchar();
            }
            break;


     case '4':
       system("cls");
           another = 'Y';
          while (another == 'Y'|| another == 'y')
          {
              cout << "\n Enter the last name of the student to delete : ";
              cin >> xlast_name;

              ft = fopen("temp.dat", "wb");

              rewind(fp);
              while (fread (&e, recsize,1,fp) == 1)

                 if (strcmp(e.last_name,xlast_name) != 0)
                {
                    fwrite(&e,recsize,1,ft);
                }
                fclose(fp);
                fclose(ft);
                remove("users.txt");
                rename("temp.dat","users.txt");

                fp=fopen("users.txt","rb+");

                cout << "\n Delete Another Record (Y/N) ";
                fflush(stdin);
                another = getchar();
              }

              break;

              case '5':
              fclose(fp);
              cout << "\n\n";
              cout << "\t\t     THANK YOU FOR USING THIS SOFTWARE";
              cout << "\n\n";
              exit(0);
          }
     }


system("pause");
return 0;
}




School Project Personal Dairy Management in C programming

#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

#include<string.h>


int password();

void addrecord();

void viewrecord();

void editrecord();

void editpassword();

void deleterecord();


struct record

{

    char time[6];

    char name[30];

    char place[25];

    char duration[10];

    char note[500];

} ;


int main()

{

    int ch;

    printf("\n\n\t***********************************\n");

    printf("\t*PASSWORD PROTECTED PERSONAL DIARY*\n");

    printf("\t***********************************");


   while(1)


        {

                printf("\n\n\t\tMAIN MENU:");

                printf("\n\n\tADD RECORD\t[1]");

                printf("\n\tVIEW RECORD\t[2]");

                printf("\n\tEDIT RECORD\t[3]");

                printf("\n\tDELETE RECORD\t[4]");

                printf("\n\tEDIT PASSWORD\t[5]");

                printf("\n\tEXIT\t\t[6]");

                printf("\n\n\tENTER YOUR CHOICE:");

                scanf("%d",&ch);


            switch(ch)

                    {

                            case 1:

                            addrecord();

                            break;


                            case 2:

                            viewrecord();

                            break;


                            case 3:

                            editrecord();

                            break;


                            case 4:

                            deleterecord();

                            break;


                            case 5:

                            editpassword();

                            break;


                            case 6:

                            printf("\n\n\t\tTHANK YOU FOR USING THE SOFTWARE BY:\n\n\tBIJAY PURI\n\n\tBHANU POUDEL\n\n\tNRIPASH AYER...");

                            getch();

                            exit(0);


                            default:

                            printf("\nYOU ENTERED WRONG CHOICE..");

                            printf("\nPRESS ANY KEY TO TRY AGAIN");

                            getch();

                            break;

                    }

                system("cls");

        }

            return 0;

}

void addrecord( )

{

                system("cls");

                FILE *fp ;

                char another = 'Y' ,time[10];

                struct record e ;

                char filename[15];

                int choice;

                printf("\n\n\t\t***************************\n");

                printf("\t\t* WELCOME TO THE ADD MENU *");

                printf("\n\t\t***************************\n\n");

                printf("\n\n\tENTER DATE OF YOUR RECORD:[yyyy-mm-dd]:");

                fflush(stdin);

                gets(filename);

                fp = fopen (filename, "ab+" ) ;

                if ( fp == NULL )

                {

                fp=fopen(filename,"wb+");

                if(fp==NULL)

                {

                    printf("\nSYSTEM ERROR...");

                    printf("\nPRESS ANY KEY TO EXIT");

                    getch();

                    return ;

                }

                }



                while ( another == 'Y'|| another=='y' )

                {

                    choice=0;

                    fflush(stdin);

                printf ( "\n\tENTER TIME:[hh:mm]:");

                scanf("%s",time);

                rewind(fp);

                while(fread(&e,sizeof(e),1,fp)==1)

                {

                    if(strcmp(e.time,time)==0)

                    {

                        printf("\n\tTHE RECORD ALREADY EXISTS.\n");

                        choice=1;

                    }

                }

                    if(choice==0)

                    {

                        strcpy(e.time,time);

                        printf("\tENTER NAME:");

                        fflush(stdin);

                        gets(e.name);

                        fflush(stdin);

                        printf("\tENTER PLACE:");

                        gets(e.place);

                        fflush(stdin);

                        printf("\tENTER DURATION:");

                        gets(e.duration);

                        fflush(stdin);

                        printf("\tNOTE:");

                        gets(e.note);

                        fwrite ( &e, sizeof ( e ), 1, fp ) ;

                        printf("\nYOUR RECORD IS ADDED...\n");

                    }

                        printf ( "\n\tADD ANOTHER RECORD...(Y/N) " ) ;

                        fflush ( stdin ) ;

                        another = getchar( ) ;

                }


                fclose ( fp ) ;

                printf("\n\n\tPRESS ANY KEY TO EXIT...");

                getch();

    }


void viewrecord( )

{

        FILE *fpte ;

        system("cls");

        struct record customer ;

        char time[6],choice,filename[14];

        int ch;

        printf("\n\n\t\t*******************************\n");

        printf("\t\t* HERE IS THE VIEWING MENU *");

        printf("\n\t\t*******************************\n\n");

        choice=password();

        if(choice!=0)

            {

                return ;

            }

        do

            {

                    printf("\n\tENTER THE DATE OF RECORD TO BE VIEWED:[yyyy-mm-dd]:");

                    fflush(stdin);

                    gets(filename);


                    fpte = fopen ( filename, "rb" ) ;

                    if ( fpte == NULL )

                            {

                                puts ( "\nTHE RECORD DOES NOT EXIST...\n" ) ;

                                printf("PRESS ANY KEY TO EXIT...");

                                getch();

                                return ;

                            }

                            system("cls");

                printf("\n\tHOW WOULD YOU LIKE TO VIEW:\n");

                printf("\n\t1.WHOLE RECORD OF THE DAY.");

                printf("\n\t2.RECORD OF FIX TIME.");

                printf("\n\t\tENTER YOUR CHOICE:");

                scanf("%d",&ch);

                switch(ch)

                {

                    case 1:

                            printf("\nTHE WHOLE RECORD FOR %s IS:",filename);

                         while ( fread ( &customer, sizeof ( customer ), 1, fpte ) == 1 )

                         {

                            printf("\n");

                            printf("\nTIME: %s",customer.time);

                            printf("\nMEETING WITH: %s",customer.name);

                            printf("\nMEETING AT: %s",customer.place);

                            printf("\nDURATION: %s",customer.duration);

                            printf("\nNOTE: %s",customer.note);

                            printf("\n");

                         }

                         break;


                    case 2:

                            fflush(stdin);

                            printf("\nENTER TIME:[hh:mm]:");

                            gets(time);

                            while ( fread ( &customer, sizeof ( customer ), 1, fpte ) == 1 )


                            {

                                if(strcmp(customer.time,time)==0)

                                {

                                    printf("\nYOUR RECORD IS:");

                                    printf("\nTIME: %s",customer.time);

                                    printf("\nMEETING WITH: %s",customer.name);

                                    printf("\nMEETING AT: %s",customer.place);

                                    printf("\nDUARATION: %s",customer.duration);

                                    printf("\nNOTE: %s",customer.note);

                                }

                            }

                            break;


                    default: printf("\nYOU TYPED SOMETHING ELSE...\n");

                             break;

                }


               printf("\n\nWOULD YOU LIKE TO CONTINUE VIEWING...(Y/N):");

               fflush(stdin);

            scanf("%c",&choice);

        }while(choice=='Y'||choice=='y');

            fclose ( fpte ) ;

            return ;

}

void editrecord()

{

        system("cls");

        FILE *fpte ;

        struct record customer ;

        char time[6],choice,filename[14];

        int num,count=0;

        printf("\n\n\t\t*******************************\n");

        printf("\t\t* WELCOME TO THE EDITING MENU *");

        printf("\n\t\t*******************************\n\n");

        choice=password();

        if(choice!=0)

            {

                return ;

            }

        do

            {

                    printf("\n\tENTER THE DATE OF RECORD TO BE EDITED:[yyyy-mm-dd]:");

                    fflush(stdin);

                    gets(filename);

                    printf("\n\tENTER TIME:[hh:mm]:");

                    gets(time);

                    fpte = fopen ( filename, "rb+" ) ;

                    if ( fpte == NULL )

                            {

                                printf( "\nRECORD DOES NOT EXISTS:" ) ;

                                printf("\nPRESS ANY KEY TO GO BACK");

                                getch();

                                return;

                            }

                    while ( fread ( &customer, sizeof ( customer ), 1, fpte ) == 1 )

                    {

                        if(strcmp(customer.time,time)==0)

                        {

                            printf("\nYOUR OLD RECORD WAS AS:");

                            printf("\nTIME: %s",customer.time);

                            printf("\nMEETING WITH: %s",customer.name);

                            printf("\nMEETING AT: %s",customer.place);

                            printf("\nDURATION: %s",customer.duration);

                            printf("\nNOTE: %s",customer.note);


                            printf("\n\n\t\tWHAT WOULD YOU LIKE TO EDIT..");

                                printf("\n1.TIME.");

                                printf("\n2.MEETING PERSON.");

                                printf("\n3.MEETING PLACE.");

                                printf("\n4.DURATION.");

                                printf("\n5.NOTE.");

                                printf("\n6.WHOLE RECORD.");

                                printf("\n7.GO BACK TO MAIN MENU.");

                                do

                                {

                                        printf("\n\tENTER YOUR CHOICE:");

                                        fflush(stdin);

                                        scanf("%d",&num);

                                        fflush(stdin);

                                        switch(num)

                                        {

                                            case 1: printf("\nENTER THE NEW DATA:");

                                                    printf("\nNEW TIME:[hh:mm]:");

                                                    gets(customer.time);

                                                    break;


                                            case 2: printf("\nENTER THE NEW DATA:");

                                                    printf("\nNEW MEETING PERSON:");

                                                    gets(customer.name);

                                                    break;


                                            case 3: printf("\nENTER THE NEW DATA:");

                                                    printf("\nNEW MEETING PLACE:");

                                                    gets(customer.place);

                                                    break;


                                            case 4: printf("\nENTER THE NEW DATA:");

                                                    printf("\nDURATION:");

                                                    gets(customer.duration);

                                                    break;


                                            case 5: printf("ENTER THE NEW DATA:");

                                                    printf("\nNOTE:");

                                                    gets(customer.note);

                                                    break;


                                            case 6:  printf("\nENTER THE NEW DATA:");

                                                     printf("\nNEW TIME:[hh:mm]:");

                                                     gets(customer.time);

                                                     printf("\nNEW MEETING PERSON:");

                                                     gets(customer.name);

                                                     printf("\nNEW MEETING PLACE:");

                                                     gets(customer.place);

                                                     printf("\nDURATION:");

                                                     gets(customer.duration);

                                                     printf("\nNOTE:");

                                                     gets(customer.note);

                                                     break;


                                            case 7: printf("\nPRESS ANY KEY TO GO BACK...\n");

                                                    getch();

                                                    return ;

                                                    break;


                                            default: printf("\nYOU TYPED SOMETHING ELSE...TRY AGAIN\n");

                                                     break;

                                        }


                                }while(num<1||num>8);

                            fseek(fpte,-sizeof(customer),SEEK_CUR);

                            fwrite(&customer,sizeof(customer),1,fpte);

                            fseek(fpte,-sizeof(customer),SEEK_CUR);

                            fread(&customer,sizeof(customer),1,fpte);

                            choice=5;

                            break;

                        }

                    }

                    if(choice==5)

                    {

                    system("cls");

                    printf("\n\t\tEDITING COMPLETED...\n");

                    printf("--------------------\n");

                    printf("THE NEW RECORD IS:\n");

                    printf("--------------------\n");

                    printf("\nTIME: %s",customer.time);

                    printf("\nMEETING WITH: %s",customer.name);

                    printf("\nMEETING AT: %s",customer.place);

                    printf("\nDURATION: %s",customer.duration);

                    printf("\nNOTE: %s",customer.note);

                    fclose(fpte);

                    printf("\n\n\tWOULD YOU LIKE TO EDIT ANOTHER RECORD.(Y/N)");

                    scanf("%c",&choice);

                    count++;

                    }

                    else

                    {

                        printf("\nTHE RECORD DOES NOT EXIST::\n");

                        printf("\nWOULD YOU LIKE TO TRY AGAIN...(Y/N)");

                        scanf("%c",&choice);

                    }


            }while(choice=='Y'||choice=='y');

            fclose ( fpte ) ;


            if(count==1)

            printf("\n%d FILE IS EDITED...\n",count);

            else if(count>1)

            printf("\n%d FILES ARE EDITED..\n",count);

            else

            printf("\nNO FILES EDITED...\n");

            printf("\tPRESS ENTER TO EXIT EDITING MENU.");

            getch();

}

int password()

{

        char pass[15]={0},check[15]={0},ch;

        FILE *fpp;

        int i=0,j;

        printf("::FOR SECURITY PURPOSE::");

        printf("::ONLY THREE TRIALS ARE ALLOWED::");

        for(j=0;j<3;j++)

        {

                        i=0;

                        printf("\n\n\tENTER THE PASSWORD:");

                        pass[0]=getch();

                        while(pass[i]!='\r')

                        {

                            if(pass[i]=='\b')

                            {

                                i--;

                                printf("\b");

                                printf(" ");

                                printf("\b");

                                pass[i]=getch();

                            }

                            else

                            {

                                printf("*");

                                i++;

                                pass[i]=getch();

                            }

                        }

                        pass[i]='\0';

                        fpp=fopen("SE","r");

                        if (fpp==NULL)

                        {

                            printf("\nERROR WITH THE SYSTEM FILE...[FILE MISSING]\n");

                            getch();

                            return 1;

                        }

                        else

                        i=0;

                        while(1)

                        {

                            ch=fgetc(fpp);

                            if(ch==EOF)

                            {

                                check[i]='\0';

                                break;

                            }

                            check[i]=ch-5;

                            i++;

                        }

                        if(strcmp(pass,check)==0)

                        {

                            printf("\n\n\tACCESS GRANTED...\n");

                            return 0;

                        }

                        else

                        {

                            printf("\n\n\tWRONG PASSWORD..\n\n\tACCESS DENIED...\n");

                        }

        }

        printf("\n\n\t::YOU ENTERED WRONG PASSWORD::YOU ARE NOT ALLOWED TO ACCESS ANY FILE::\n\n\tPRESS ANY KEY TO GO BACK...");

        getch();

        return 1;

}

void editpassword()

{

    system("cls");

    printf("\n");

    char pass[15]={0},confirm[15]={0},ch;

    int choice,i,check;

    FILE *fp;

    fp=fopen("SE","rb");

    if(fp==NULL)

    {

        fp=fopen("SE","wb");

        if(fp==NULL)

        {

            printf("SYSTEM ERROR...");

            getch();

            return ;

        }

        fclose(fp);

        printf("\nSYSTEM RESTORED...\nYOUR PASSWORD IS 'ENTER'\n PRESS ENTER TO CHANGE PASSWORD\n\n");

        getch();

    }

        fclose(fp);

        check=password();

    if(check==1)

    {

        return ;

    }

    do

    {

        if(check==0)

                    {

                        i=0;

                        choice=0;

                        printf("\n\n\tENTER THE NEW PASSWORD:");

                        fflush(stdin);

                        pass[0]=getch();

                        while(pass[i]!='\r')

                        {

                            if(pass[i]=='\b')

                            {

                                i--;

                                printf("\b");

                                printf(" ");

                                printf("\b");

                                pass[i]=getch();

                            }

                            else

                            {

                                printf("*");

                                i++;

                                pass[i]=getch();

                            }

                        }

                        pass[i]='\0';

                        i=0;

                        printf("\n\tCONFIRM PASSWORD:");

                        confirm[0]=getch();

                        while(confirm[i]!='\r')

                        {

                            if(confirm[i]=='\b')

                            {

                                i--;

                                printf("\b");

                                printf(" ");

                                printf("\b");

                                confirm[i]=getch();

                            }

                            else

                            {

                                printf("*");

                                i++;

                                confirm[i]=getch();

                            }

                        }

                        confirm[i]='\0';

                        if(strcmp(pass,confirm)==0)

                        {

                            fp=fopen("SE","wb");

                            if(fp==NULL)

                            {

                                printf("\n\t\tSYSTEM ERROR");

                                getch();

                                return ;

                            }

                            i=0;

                            while(pass[i]!='\0')

                            {

                                ch=pass[i];

                                putc(ch+5,fp);

                                i++;

                            }

                            putc(EOF,fp);

                            fclose(fp);

                        }

                        else

                        {

                            printf("\n\tTHE NEW PASSWORD DOES NOT MATCH.");

                            choice=1;


                        }


                    }

}while(choice==1);


    printf("\n\n\tPASSWORD CHANGED...\n\n\tPRESS ANY KEY TO GO BACK...");

    getch();

}


void deleterecord( )

{

                system("cls");

                FILE *fp,*fptr ;

                struct record file ;

                char filename[15],another = 'Y' ,time[10];;

                int choice,check;

                printf("\n\n\t\t*************************\n");

                printf("\t\t* WELCOME TO DELETE MENU*");

                printf("\n\t\t*************************\n\n");

                check = password();

                    if(check==1)

                    {

                        return ;

                    }


                while ( another == 'Y' )

                {

                printf("\n\n\tHOW WOULD YOU LIKE TO DELETE.");

                printf("\n\n\t#DELETE WHOLE RECORD\t\t\t[1]");

                printf("\n\t#DELETE A PARTICULAR RECORD BY TIME\t[2]");


                do

                {

                        printf("\n\t\tENTER YOU CHOICE:");

                        scanf("%d",&choice);


                    switch(choice)

                        {

                            case 1:

                            printf("\n\tENTER THE DATE OF RECORD TO BE DELETED:[yyyy-mm-dd]:");

                            fflush(stdin);

                            gets(filename);

                            fp = fopen (filename, "wb" ) ;

                            if ( fp == NULL )

                            {

                                printf("\nTHE FILE DOES NOT EXISTS");

                                printf("\nPRESS ANY KEY TO GO BACK.");

                                getch();

                                return ;

                            }

                            fclose(fp);

                            remove(filename);

                            printf("\nDELETED SUCCESFULLY...");

                            break;


                            case 2:

                            printf("\n\tENTER THE DATE OF RECORD:[yyyy-mm-dd]:");

                            fflush(stdin);

                            gets(filename);

                            fp = fopen (filename, "rb" ) ;

                            if ( fp == NULL )

                            {

                                printf("\nTHE FILE DOES NOT EXISTS");

                                printf("\nPRESS ANY KEY TO GO BACK.");

                                getch();

                                return ;

                            }

                            fptr=fopen("temp","wb");

                            if(fptr==NULL)

                            {

                                printf("\nSYSTEM ERROR");

                                printf("\nPRESS ANY KEY TO GO BACK");

                                getch();

                                return ;

                            }

                            printf("\n\tENTER THE TIME OF RECORD TO BE DELETED:[hh:mm]:");

                            fflush(stdin);

                            gets(time);

                            while(fread(&file,sizeof(file),1,fp)==1)

                            {

                                if(strcmp(file.time,time)!=0)

                                fwrite(&file,sizeof(file),1,fptr);

                            }


                            fclose(fp);

                            fclose(fptr);

                            remove(filename);

                            rename("temp",filename);

                            printf("\nDELETED SUCCESFULLY...");

                            break;


                    default:

                            printf("\n\tYOU ENTERED WRONG CHOICE");

                            break;

                    }

                }while(choice<1||choice>2);



                    printf("\n\tDO YOU LIKE TO DELETE ANOTHER RECORD.(Y/N):");

                    fflush(stdin);

                    scanf("%c",&another);

                }

                printf("\n\n\tPRESS ANY KEY TO EXIT...");

                getch();

}







Banking System Project

//*************************************************************** //                   HEADER FILE USED IN PROJECT //********************...