#include<stdio.
h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
#include<windows.h>
#include<time.h>
#define ENTER 13
#define BKSP 8
#define SPACE 32
#define TAB 9
struct item
 {
      char   productname[41],productcomp[40],c;
       int   price;
       int   productid;
       int   Qnt;
}st;
void wel_come(void);
void title(void);
void login();
void menu(void);
void title(void);
void REMOVEPRODUCT(void);
void add_item();
void read_item();
void search_item();
void edit_item();
void total_bill();
void main(void)
{
wel_come();
login();
}
void wel_come(void)
{
     printf("\xbd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\xbd\n");
       printf("\xbd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\xbd\n");
       printf("\xbd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\xbd\n");
       printf("\xbd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\xbd\n");
       printf("\xbd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\xbd\n");
      printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\t\t\t\t\t\t\xbd\n");
      printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\t\t\t\t\t\t\
xbd\n");
      printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\t\t\t\t\t\t\xbd\n");
      printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\t\t\t\t\t\
t\xbd\n");
      printf("\t\t\t\t\t DEAR CUSTOMER, WELCOME TO, \t\t\t\t\t\t\t\n");
      printf("\t\t\t\t\t    RADIANTEE SPORTS WORLD    \t\t\t\t\t\t\t\n");
    printf("\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t     PLEASE CONTACT US AT :-     \t\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t          44587574           \t\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t\"WE IMPORT YOUR FAVOURITE SPORTSWEAR AND FOOTBALL KITS\" \
t\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\t\t\t\t\t\t\xbd\n");
    printf("\xbd\t\t\t\t\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\t\t\t\t\t\t\xbd\n");
    printf("\n\t\t\ ENTER ANY KEY TO CONTINUE........\t\t\t\t\t\t\t\t\t\t\n");
getch();
system("cls");
}
void login()
{
int a=0,i=0;
    char uname[20],c=' ';
    char pword[20],code[10];
    char user[20]="user";
    char pass[20]="pass";
    do
{
    printf("\n \xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb LOGIN \xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb ");
    printf(" \nUSERNAME:-");
      scanf("%s", &uname);
      printf(" \nPASSWORD:-");
      while(i<10)
      {
           pword[i]=getch();
           c=pword[i];
           if(c==13) break;
           else printf("*");
           i++;
      }
      pword[i]='\0';
      i=0;
             if(strcmp(uname,"username")==0 && strcmp(pword,"password")==0)
        {
        printf("\nWELCOME TO SPORTSWORLD SHOP MANAGEMENT SYSTEM. LOGIN IS
SUCCESSFUL\n");
        printf("\n\n ENJOY YOUR TIME, PLEASE WAIT FOR A FEW SECONDS.... \n");
    for(i=0; i<3; i++)
    {
        printf(".");
    }
        printf("\n\n\n\t\t\t\t Please Press any key to continue...");
        getch();
        break;
        }
        else
        {
               printf("\nNOT VALID USERNAME OR PASSWORD :( please try again \n");
              a++;
              getch();
        }
}
        while(a<=2);
        if (a>2)
        {
              printf("\nSORRY... EXITING ENTIRE PROCESS");
             getch();
             }
             system("cls");
             menu();
}
void menu(void)
{
      int choice;
      system("cls");
      main:
      printf("\n\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
      printf("\n\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
      printf("\n\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdbSPORTSWORLD SHOP MANAGEMENT SYSTEM\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb");
      printf("\n\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
      printf("\n\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
      printf("
");
      printf("
");
      printf("\n\t\t \xdb To Add Items to your shopping cart=====PRESS [1]");
     printf("\n\t\t \xdb To remove anything from your cart======PRESS [2]");
     printf("\n\t\t \xdb To Search products in our store========PRESS [3]");
     printf("\n\t\t \xdb To Edit any products===================PRESS [4]");
     printf("\n\t\t \xdb Calculate your total bill==============PRESS [5]");
     printf("\n\t\t \xdb For Exit===============================PRESS [6]");
     printf("\n\n\t\t YOU CAN CHOOSE FROM[1-6]");
     scanf("%i", &choice);
     system("cls");
      switch(choice)
      {
case 1:
Add_products();
break;
case 2:
remove_product();
break;
case 3:
search_Products();
break;
case 4:
edit_Products();
break;
case 5:
your_total_bill();
break;
case 6:
    printf(" EXITING NOW.... ");
    exit(0);
break;
default:
printf("EXITING WHOLE SYSTEM...\n");
getch();
   }
 }
void Add_products()
{
      int index, valid;
      char c;
      int a=0;
      FILE *fp;
      do
      {
            system("cls");
            printf("\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb Enter some
Information about your item \xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
            printf("\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
            printf("\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\
xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb");
            int ID;
            fp = fopen("NextFile.dat","a+");
            if((fp = fopen("NextFile.dat","a+"))!=NULL)
            {
                  I:
                  printf("\n PLEASE ENTER THE PRODUCT CODE \t :");
                  scanf("%i",&ID);
                  while(fscanf(fp,"%s %s %i %i %i", st.productname, st.productcomp,
&st.price, &st.productid,&st.Qnt)!=EOF)
                  {
                        if(ID == st.productid)
                        {
                              printf("\n\t THE PRODUCT CODE SEEMINGLY EXISTS .\n");
                              goto I;
                        }
                  }
                  st.productid = ID;
            }
            else
            {
                  printf("\nProduct Code\t :");
                  scanf("%i",&st.productid);
            }
            do
            {
                  fflush(stdin);
                  printf("\n Name of the Item\t :");
                  gets(st.productname);
                  st.productname[0]=toupper(st.productname[0]);
                 for (index=0; index<strlen(st.productname); ++index)
                 {
                       if(isalpha(st.productname[index]))
                             valid = 1;
                       else
                       {
                             valid = 0;
                             break;
                       }
                 }
                 if (!valid)
                 {
                       printf("\n THE NAME CONTAINS UNSPECIFIED CHARACTERS, PLEASE
'ENTER' AGAIN ");
                       getch();
                 }
           }while(!valid);
                 do
           {
                 char productcomp[40];
                 fflush(stdin);
                 printf("\nItem Brand\t :");
                 gets(st.productcomp);
                 st.productcomp[0]=toupper(st.productcomp[0]);
                    for (index=0; index<strlen(st.productcomp); ++index)
                    {
                          if(isalpha(st.productcomp[index]))
                                valid = 1;
                          else
                          {
                                valid = 0;
                                break;
                          }
                    }
                    if (!valid)
                    {
                          printf("\n THE NAME CONTAINS UNSPECIFIED CHARACTERS, PLEASE
'ENTER' AGAIN ");
                        getch();
                  }
            }while(!valid);
            do
                  {
                        printf("\nPrice [467-4670] taka:");
                        scanf("%i",&st.price);
                        if(st.price<400 || st.price>5000)
                        {
                              printf("\n\tYou Cannot Enter the price limit [300-
4900].Re-Enter.");
                        }
                  }while(st.price<10 || st.price>5000);
                         do
                    {
                        printf("\nQuantity [90-640]\t:");
                        scanf("%i",&st.Qnt);
                        if(st.Qnt<10 || st.Qnt>550)
                        {
                              printf("\n\tEnter Quantity[1-500] only.Re-Enter.");
                        }
                  }while(st.Qnt<20 || st.Qnt>700);
            fp=fopen("NextFile.dat","a");
            fprintf(fp,"\n%s %s %i %i %i", st.productname, st.productcomp,st.price,
st.productid,st.Qnt);
            fclose(fp);
            printf("\nFOR ADDING MORE ITEM, PRESS 'ENTER', FOR ENTERING MAIN MENU,
CLICK ANY BUTTON");
      }
      while((c = getch()) =='\r');
      menu();
}
void remove_product(void)
{
      char target[40];
      int found=0;
      FILE *sfile, *tfile;
      sfile=fopen("NextFile.dat","r");
      tfile=fopen("TempFile.dat","w+");
      printf("\n ENTER NAME OF THE PRODUCT TO REMOVE ");
      fflush(stdin);
      scanf("%s",target);
      target[0]=toupper(target[0]);
      while (fscanf(sfile,"%s %s %i %i %i\n",st.productname,st.productcomp,
&st.price,&st.productid,&st.Qnt)!=EOF)
      {
            if(strcmp(target,st.productname)==0)
            {
                  found=1;
            }
            else
            {
                  fprintf(tfile,"%s %s %i %i %i\n", st.productname,st.productcomp,
st.price,st.productid,st.Qnt);
            }
      }
                  if(!found)
                  {
                        printf("\n Record not Found");
                        getch();
                        menu();
                  }
                  else
                  {
                        printf("\n Record completely removed ");
                  }
                  fclose(sfile);
                  fclose(tfile);
                  remove("NextFile.dat");
                  rename("TempFile.dat","NextFile.dat");
                 printf("\nPLEASE PRESS ANY KEY TO ENTER MAIN MENU");
           while((st.c = getch()) =='\r');
           menu();
}
void search_Products()
{
      char target[40];
      int found=0;
      FILE *sfile;
      sfile=fopen("NextFile.dat","r");
      printf("\nENTER NAME OF THE PRODUCT TO SEARCH:");
      fflush(stdin);
      gets(target);
      target[0]=toupper(target[0]);
      while (!feof(sfile) && found==0)
      {
            fscanf(sfile,"%s %s %i %i %i", st.productname, st.productcomp,
&st.price, &st.productid,&st.Qnt);
            if(strcmp(target, st.productname)==0)
            {
                  found=1;
            }
      }
      if(found)
      {
            printf("\n RECORD FOUND");
     }
     else
            printf("RECORD COULDNT BE FOUND ");
            fclose(sfile);
            printf("\nENTER ANY KEY TO MAIN MENU");
            while((st.c = getch()) =='\r');
            menu();
}
void edit_Products()
{
      int index, valid;
      char target[40];
      FILE *fp, *rp;
      int a=0;
      int id;
      char edit;
      long int size=sizeof(st);
      if((fp=fopen("NextFile.dat","r+"))==NULL)
      {
            printf("NO RECORD ADDED.");
            menu();
      }
      else
      {
            rp = fopen("TempFile.dat","a");
            system("cls");
            printf("Enter Item's' Code for edit:");
            scanf("%i",&id);
            fflush(stdin);
            while(fscanf(fp,"%s %s %i %i %i\n", st.productname,st.productcomp,
&st.price, &st.productid,&st.Qnt)!=EOF)
            {
                  if(id==st.productid)
                  {
                        a=1;
                        printf("\n\t\xdb\xdb\xdb\xdb\xdb Record Found \xdb\xdb\xdb\
xdb\xdb");
                        printf("\nNAME OF THE SPORTSWEAR PRODUCT\t\t:
%s",st.productname);
                        printf("\nNAME OF THE SPORTSWEAR BRAND\t\t:
%s",st.productcomp);
                        printf("\nPRICE\t\t\t: %i",st.price);
                        printf("\nPRODUCT CODE\t\t: %i",st.productid);
                        printf("\nAGGREGRATE AMOUNT OF PRODUCT\t:%i",st.Qnt);
                       printf("\n\n\t***THE NEW RECORD***");
                 do
                       {
                              fflush(stdin);
                              printf("\nTHE NAME OF NEW PRODUCT\t\t: ");
                              gets(st.productname);
                              st.productname[0]=toupper(st.productname[0]);
                              for (index=0; index<strlen(st.productname); ++index)
                              {
                                    if(isalpha(st.productname[index]))
                                          valid = 1;
                                    else
                                    {
                                          valid = 0;
                                          break;
                                    }
                              }
                              if (!valid)
                              {
                                    printf("\n NAME CONTAINS UNSPECIFIED
CHARACTERS,PLEASE PRESS 'ENTER' AGAIN");
                                    getch();
                              }
                        }while(!valid);
                        do
                        { char productcomp[40];
                              fflush(stdin);
                              printf("\nNEW PRODUCTS BRAND\t\t:");
                              gets(st.productcomp);
                              st.productcomp[0]=toupper(st.productcomp[0]);
                              for (index=0; index<strlen(st.productcomp); ++index)
                              { if(isalpha(st.productcomp[index]))
                                          valid = 1;
                                    else
                                    {
                                          valid = 0;
                                          break;
                                    }
                              }
                              if (!valid)
                              {
                                    printf("\nNAME CONTAINS UNSPECIFIED
CHARACTERS,PLEASE PRESS 'ENTER' AGAIN");
                                    getch();
                              }
                        }while(!valid);
                             do
                 {
                        printf("\nTHE NEW PRICE [50-6000]TAKAS:");
                        scanf("%i",&st.price);
                        if(st.price<1 || st.price>6000)
                        {
                              printf("\n\tYOUR REQUEST IS DENIED DUE TO PRICE LIMIT
[10-5000]ENTER AGAIN.");
                        }
                  }while(st.price<10 || st.price>5000);
                       printf("\nEnter New product's Code\t\t:");
                       scanf("%i",&st.productid);
                       do
                 {
                       printf("\nNew Quantity of product [1-500]\t:");
                       scanf("%i",&st.Qnt);
                       if(st.Qnt<1 || st.Qnt>500)
                       {
                             printf("\n\tEnter new quantity[1-500], Re-enter");
                       }
                 }while(st.Qnt<1 || st.Qnt>500);
                       printf("Press 'y' to edit the existing record or any key to
cancel...");
                        edit=getche();
                        if(edit=='y' || edit=='Y')
                        {
                              fprintf(rp,"%s %s %i %i %i\n", st.productname,
st.productcomp, st.price, st.productid,st.Qnt);
                              fflush(stdin);
                              printf("\n\n\t\tYOUR RECORD IS SUCCESSFULLY
EDITED!!!");
                        }
                  }
                  else
                  {
                        fprintf(rp,"%s %s %i %i %i\n", st.productname,
st.productcomp, st.price, st.productid,st.Qnt);
                        fflush(stdin);
                  }
            }
            if(!a)
            {
                  printf("\n\nTHIS ITEM DOESN'T EXIST!!!!");
            }
            fclose(rp);
            fclose(fp);
            remove("NextFile.dat");
            rename("TempFile.dat","NextFile.dat");
            getch();
      }
      menu();
}
void your_total_bill()
{
  float total_amount, amount, sub_total, discount_amount, tax_amount, quantity,
value, discount, tax;
  printf("\n Enter the quantity of item sold: ");
  scanf ("%f", &quantity) ;
  printf("\n Enter the value of item: ");
  scanf("%f", &value);
  printf("\n Enter the discount percentage: ");
  scanf("%f", &discount);
  printf (" \n Enter the tax: ") ;
  scanf ("%f", &tax) ;
  amount = quantity * value;
  discount_amount = (amount* discount)/100.0;
  sub_total =amount - discount_amount;
  tax_amount= (sub_total*tax) /100.0;
  total_amount =sub_total+ tax_amount;
  printf (" \n\n\n \xdb\xdb\xdb\xdb\xdb BILL \xdb\xdb\xdb\xdb\xdb ") ;
    printf("\nQuantitySold: %f", quantity);
    printf("\nPriceperitem: %f", value);
    printf (" \n -------------") ;
    printf ("\nAmount: %f", amount);
    printf (" \n Discount: - %f", discount_amount) ;
    printf ("\n Discounted Total: %f", sub_total) ;
    printf ("\n Tax:+ %f", tax_amount);
    printf("\n-------------");
    printf ("\n Total Amount %f", total_amount);
    getch();
    menu();
}