ude #include #include void proj_name(void); void created(void); class consumer { public: long unsigned int tel_no; long unsigned int con_no; char name[60]; char add[300]; char city[40]; long unsigned int op_rdg; long unsigned int cl_rdg; lo ng unsigned int met_calls; long unsigned int free_calls; long unsigned int charg e_calls; float met_charge; float rent; float debits; float tax; float credits; f loat gross_amt; float surcharge; long unsigned int net_amt_bef; long unsigned in t net_amt_aft; public: void get_data(void); void show_data(void); }; void cons umer::get_data(void) { setfillstyle(1,BLACK); bar(0,0,680,480); consumer g1; int a; char ch; setlinestyle(0,0,3); setcolor(BROWN); settextstyle(1,0,5); outtextx y(90,20,"ENTER THE RECORD:-"); setfillstyle(1,BLACK); bar(50,100,550,400); recta ngle(50,100,550,400); gotoxy(10,10); cout< <"TELEPHONE NO. :"; cout<>op_rdg; got oxy(10,20); cout< <"CLOSING READING :"; cin>>cl_rdg; met_calls=cl_rdg-op_rdg; fr ee_calls=150; rent=360; if(met_calls>debits; tax=(rent+met_charge+debits)/20; gr oss_amt=(met_charge+rent+tax+debits); gotoxy(10,24); cout< <"CREDITS :"; cin>>cr edits; if(credits>gross_amt) net_amt_bef=0; else net_amt_bef=gross_amt-credits; if(credits>=gross_amt) surcharge=0; else surcharge=20; net_amt_aft=net_amt_bef+s urcharge; } void consumer::show_data(void) { bar(0,0,660,480); setcolor(RED); settextstyle(8,0,3); outtextxy(55,10,"BHARAT SANCHAR NIGAM LIMITED"); setlinesty le(1,0,3); line(51,40,486,40); gotoxy(10,5); settextstyle(3,0,1); setcolor(BROWN ); outtextxy(15,55,"TELEPHONE NO."); outtextxy(330,55,"CONSUMER NO."); outtextxy (15,170,"OPENING READING "); outtextxy(15,205,"CLOSING READING "); outtextxy(15, 235,"METERED CALLS "); outtextxy(15,268,"FREE CALLS "); outtextxy(15,300,"CHARGA BLE CALLS "); setcolor(BROWN); outtextxy(330,170,"METERED CALLS "); outtextxy(33 0,205,"DEBITS "); outtextxy(330,235,"TAXES "); outtextxy(330,268,"GROSS AMOUNT " ); outtextxy(330,300,"CREDITS "); outtextxy(330,140,"RENTAL "); setcolor(MAGENTA ); outtextxy(15,327,"AMOUNT PAYABLE IF PAID ON OR BEFORE "); setcolor(BROWN); ou ttextxy(15,350,"SURCHARGE "); setcolor(MAGENTA); outtextxy(15,377,"AMOUNT PAYABL E IF PAID ON OR AFTER "); setcolor(RED); setlinestyle(0,0,3); bar(70,90,320,160) ; rectangle(70,90,320,160); gotoxy(20,5); cout< >a; setfillstyle(1,0); //TO AD D NEW RECORD if(a==1) { do { setfillstyle(1,LIGHTMAGENTA); bar(0,0,679,679); set textstyle(1,0,4); setcolor(BLUE); outtextxy(90,10,"ENTER THE RECORD:-"); gotoxy( 40,9); long unsigned int tel_no; outtextxy(50,110,"TELEPHONE_NO :"); cin>>tel_no ; fin.seekg(0); do { fin.read((char*)&g1,sizeof(g1)); if(fin.eof()) break; if(g1 .tel_no==tel_no) { bar(0,0,679,679); settextstyle(1,0,3); setfillstyle(1,LIGHTCY AN); bar(20,200,610,250); outtextxy(20,220,"PERSON WITH THIS TELEPHONE_NO ALREAD Y EXISTS"); delay(2000); goto u; } }while(!fin.eof()); fin.close(); fin.open("m. dat",ios::app|ios::out|ios::in|ios::ate|ios::binary); fin.seekg(0,ios::end) ; lo ng unsigned int r=fin.tellg(); long unsigned int t=(r/sizeof(g1))+1; con_no=t; g 1.tel_no=tel_no; g1.con_no=con_no; g1.get_data(); fin.write((char*)&g1,sizeof(g1 )); setcolor(RED); settextstyle(8,0,4); outtextxy(12,420,"ENTER ANY OTHER RECORD (Y/N)"); setfillstyle(1,4); bar(250,450,270,470); gotoxy(37,35); answer=getche() ; } while ((answer=='Y')||(answer=='y')); goto u; } //TO SEE THE RECORDS else if(a==2) { fin.seekg(0); fin.read((char*)&g1,sizeof(g1)) ; do { clrscr(); g1.sho w_data(); fin.read((char*)&g1,sizeof(g1)); getch(); } while(!fin.eof()); fin.clo se(); goto i; } //FOR ENQUIRY else if (a==3) { long unsigned int tel_no1; bar( 0,0,679,679); setcolor(GREEN); outtextxy(70,150,"ENTER THE TELEPHONE_NO OF PERSO N :"); gotoxy(35,15); cin>>tel_no1; bar(0,0,679,679); fin.seekg(0); do { fin.rea d((char*)&g1,sizeof(g1)); if(fin.eof()) goto y; else if(g1.tel_no==tel_no1) brea k; } while(fin); g1.show_data(); getch(); goto u; } //FOR MODIFICATION else if (a==4) { long unsigned int tel_no2; long unsigned int con_no; char name[60]; cha r add[300]; char city[40]; long unsigned int op_rdg; long unsigned int cl_rdg; l ong unsigned int met_calls; long unsigned int free_calls; long unsigned int char ge_calls; float met_charge; float rent; float debits; float tax; float credits; float gross_amt; float surcharge; long unsigned int net_amt_bef; long unsigned i nt net_amt_aft; bar(0,0,679,679); setcolor(MAGENTA); outtextxy(100,150,"ENTER TH E TELEPHONE_NO OF PERSON "); outtextxy(100,180," TO BE MODIFIED "); gotoxy(35,17 ); cin>>tel_no2; setfillstyle(1,0); fin.seekg(0); do { fin.read((char*)&g1,sizeo f(g1)); if(fin.eof()) { setfillstyle(1,LIGHTMAGENTA); bar(0,0,679,679); setfills tyle(1,LIGHTCYAN); bar(40,200,565,250); setcolor(BLUE); settextstyle(1,0,3); out
textxy(70,220,"DESIRED TELEPHONE_NO DOES NOT EXISTS"); delay(2000); setfillstyle