Page 516 - C++
P. 516

Water Billing System
            A project to keep record of Residents, their water consumption and to generate Bills

            struct Date
            {
                   int dd,mm,yy;
            };
            class Resident
            {
                   int R_code;
                   char Name[30],FatherName[20],Address[30],Phone[10],Mobile[15], pincode[8];
                   float Arrear;
                   public:
                   void RGetdata();
                   void RDisplaydate();
                   int Return_Rcode() {         return R_code;
                   }
                   char *Return_name() { return Name; }
                   int Return_Arrear ( )
                   {
                                 return Arrear;
                   }
                   void Update_Arrear(int amt){ Arrear=amt;  }
            };
            class Monthly_cons
            {
                   int R_code;
                   int Unit_consumed;
                   Date Bill_dt,Due_dt,payment_dt;
                   char paid;
                   float Bill_amt,Fin_amt;
                   public:
                   void MGetdata();
                   void Mdisplaydata();
                   int Return_Ward_no(){return R_code;}
                   int Return_Ch(Date pd)
                   {
                          if (pd,dd<=Due_dt.dd && pd.mm == Due_dt && pd.yy==Due+dt.yy.)
                          {
                                 Paid=’Y’;
                                 Payment_dt.dd=pd.dd;
                                 Payment_dt.mm=pd.mm;
                                 Payment_dt.yy=pd.yy;
                                 return Bill_amt;
                          }
                          else
                          {
                                 Paid=’Y’;
                                 Payment_dt.dd=pd.dd;
                                 Payment_dt.mm=pd.mm;
                                 Payment_dt.yy=pd.yy;
                                 return Fin_amt;
                   }
                   float Return_Fin_amt(){      return Fin_amt;      }

            };
   511   512   513   514   515   516   517