Page 475 - C++
P. 475
Electricity Billing System
A project to store record of Residents, their Electricity 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;
}