Beruflich Dokumente
Kultur Dokumente
PROJECT FILE
ON
TELEPHONE BILLING
SYSTEM
PREPARED BY:
V. Udaya Bhaskar
XII A
YEAR:2010-11
BOARD RL NO:
|Page 1
INDEX:
• Certificate
• Acknowledgement
• Header files used and their
purpose
• Functions used and their purpose
• Introduction
• Source Coding
• Output
• Bibliography
|Page 2
ACKNOWLEDGEMENT
I would like to express my sincere
gratitude to my computer science teacher
Mrs. Rashmi for her vital support,
guidance and encouragement without
which this practical file would not have
been completed.
CERTIFICATE
|Page 3
This is to certify that V.Udaya Bhaskar.
of class 12 ‘A’ of Sindhi High school,
Hebbal has successfully completed the
project on C++ as entailed in the AISSCE
exam of CBSE for the year 2010-11.
REG NO:
______ ________
EXAMINER’S TEACHER’S
SIGNATURE SIGNATURE
|Page 4
1. FSTREAM.H – for file handling, cin and cout
|Page 5
FUNCTIONS USED AND
THEIR PURPOSE:
• Projname():To display project name.
|Page 6
INTRODUCTION:
|Page 8
Call Detail Record (CDR) Structure
|Page 9
Major Billing Functions
| P a g e 10
SOURCE CODE:
#include<graphics.h>
#include<fstream .h>
#include<iomanip .h>
#include<string .h>
#include<process .h>
#include<stdlib .h>
#include<iostream .h>
#include<conio .h>
#include<stdio .h>
#include<dos .h>
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;
| P a g e 11
long unsigned int met_calls;
long unsigned int free_calls;
long unsigned int charge_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 int net_amt_aft;
public:
void get_data(void);
void show_data(void);
};
void consumer::get_data(void)
{
setfillstyle(2,BLACK);
bar(0,0,680,480);
consumer g1; int a; char ch;
setlinestyle(0,0,3);
setcolor(BROWN);
settextstyle(1,0,5);
outtextxy(90,20,"ENTER THE RECORD:-");
setfillstyle(1,BLACK);
bar(50,100,550,400);
rectangle(50,100,550,400);
| P a g e 12
gotoxy(10,10);
cout<<"TELEPHONE NO. :";
cout<<tel_no;
cin.get(ch);
gotoxy(10,12);
cout<<"NAME :";
cin.getline(name,60);
gotoxy(10,14);
cout<<"ADDRESS :";
cin.getline(add,300);
gotoxy(10,16);
cout<<"CITY :";
cin.getline(city,40);
gotoxy(10,18);
cout<<"OPENING READING :";
cin>>op_rdg;
gotoxy(10,20);
cout<<"CLOSING READING :";
cin>>cl_rdg;
met_calls=cl_rdg-op_rdg;
free_calls=150;
rent=360;
if(met_calls<free_calls )
{
charge_calls=0;
met_charge=0;
}
else
{
| P a g e 13
charge_calls=met_calls-free_calls;
met_charge=charge_calls*(.80);
}
gotoxy(10,22);
cout<<"DEBITS :";
cin>>debits;
tax=(rent+met_charge+debits)/20;
gross_amt=(met_charge+rent+tax+debits);
gotoxy(10,24);
cout<<"CREDITS :";
cin>>credits;
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+surcharge;
}
void consumer::show_data(void)
{
bar(0,0,660,480);
setcolor(RED);
settextstyle(8,0,3);
outtextxy(55,20,"HINDUSTAN COMMUNICATIONS
LIMITED");
| P a g e 14
setlinestyle(1,0,3);
line(51,40,486,40);
gotoxy(10,5);
settextstyle(3,0,1);
setcolor(MAGENTA);
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,"CHARGABLE CALLS ");
setcolor(MAGENTA);
outtextxy(330,170,"METERED CALLS ");
outtextxy(330,205,"DEBITS ");
outtextxy(330,235,"TAXES ");
outtextxy(330,268,"GROSS AMOUNT ");
outtextxy(330,300,"CREDITS ");
outtextxy(330,140,"RENTAL
");
setcolor(RED);
outtextxy(15,327,"AMOUNT PAYABLE IF PAID ON
OR BEFORE ");
setcolor(MAGENTA);
outtextxy(15,350,"SURCHARGE
");
setcolor(RED);
outtextxy(15,377,"AMOUNT PAYABLE IF PAID ON
OR AFTER ");
| P a g e 15
setcolor(MAGENTA);
setlinestyle(0,0,3);
bar(70,90,320,160);
rectangle(70,90,320,160);
gotoxy(20,5);
cout<<tel_no;
gotoxy(60,5);
cout<<con_no;
gotoxy(12,7);
cout<<name<<"\n";
gotoxy(12,8);
cout<<add<<"\n";
gotoxy(12,9);
cout<<city;
gotoxy(54,10);
cout<<setw(20)<<rent;
gotoxy(25,12);
cout<<setw(15);
cout<<op_rdg;
gotoxy(25,14);
cout<<setw(15)<<cl_rdg;
gotoxy(25,16);
cout<<setw(15)<<met_calls;
gotoxy(25,18);
cout<<setw(15)<<free_calls;
gotoxy(25,20);
cout<<setw(15)<<charge_calls;
gotoxy(59,12);
cout<<setw(15)<<met_charge;
| P a g e 16
gotoxy(59,14);
cout<<setw(15)<<debits;
gotoxy(59,16);
cout<<setw(15)<<tax;
gotoxy(59,18);
cout<<setw(15)<<gross_amt;
gotoxy(59,20);
cout<<setw(15)<<credits;
gotoxy(50,22);
cout<<setw(5)<<net_amt_bef;
gotoxy(25,23);
cout<<setw(15)<<surcharge;
gotoxy(50,25);
cout<<setw(5)<<net_amt_aft;
}
void main()
{
char ans; int con_no;
int gd=DETECT,gm; int i,j;
int midx,midy;
initgraph(&gd,&gm,"c:\\tc\\bgi");
//initgraph(graph driver,graphmode,pathodedriver)
midx=getmaxx()/2; midy=getmaxy()/2;
setlinestyle(1,0,2);
setfillstyle(1,RED);
rectangle(2,1,660,660);
bar(2,1,660,660);
| P a g e 17
setcolor(LIGHTCYAN);
for(i=90;i<=385;i+=17)
{
outtextxy(50,i,"!");
outtextxy(560,i,"*");
}
for(j=50;j<=560;j+=17)
{
outtextxy(j,90,"!");
outtextxy(j,385,"*");
}
setfillstyle(1,LIGHTGRAY);
ellipse(310,240,0,360,240,120);
fillellipse(310,240,240,120);
setfillstyle(1,LIGHTCYAN);
ellipse(312,241,0,360,200,100);
fillellipse(312,241,200,100);
setfillstyle(1,LIGHTGRAY);
ellipse(314,242,0,360,160,80);
fillellipse(314,242,160,80);
settextstyle(0,0,3);
settextstyle(1,HORIZ_DIR,4);
setcolor(BLUE);
outtextxy(250,200,"WELCOME");
settextstyle(1,0,4);
for(i=220;i<229;i++)
{
outtextxy(280,i,"TO");
}
| P a g e 18
settextstyle(0,0,3);
for(i=270;i<280;i++)
{
outtextxy(190,270,"OUR PROJECT");
}
sleep(1);
sleep(1);
proj_name();
sleep(1);
created();
fstream fin; consumer g1;
i:
fin.open("m.dat",ios::in|ios::out|ios::app|ios::ate|
ios::binary);
fin.seekg(0,ios::end);
int a; char answer;
setfillstyle(1,LIGHTMAGENTA);
rectangle(0,0,600,480);
bar(0,0,700,480);
setcolor(RED);
settextstyle(1,0,5);
setlinestyle(1,0,3);
outtextxy(10,20,"ENTER YOUR CHOICE:-");
settextstyle(1,0,3);
outtextxy(100,120,"PRESS 1:TO ADD NEW
RECORD");
outtextxy(100,150,"PRESS 2:TO SEE THE
RECORDS");
outtextxy(100,180,"PRESS 3:FOR ENQUIRY");
| P a g e 19
outtextxy(100,210,"PRESS 4:FOR
MODIFICATION");
outtextxy(100,240,"PRESS 5:FOR EXIT");
setfillstyle(1,LIGHTMAGENTA);
bar(580,370,640,420);
gotoxy(77,25);
cin>>a;
setfillstyle(1,0);
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) ;
| P a g e 21
long unsigned int r=fin.tellg();
long unsigned int t=(r/sizeof(g1))+1;
con_no=t;
g1.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;
}
//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
PERSON :");
gotoxy(35,15);
cin>>tel_no1;
bar(0,0,679,679);
fin.seekg(0);
do
{
fin.read((char*)&g1,sizeof(g1));
if(fin.eof())
goto y;
else if(g1.tel_no==tel_no1)
break;
}
while(fin);
| P a g e 23
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];
char add[300];
char city[40];
long unsigned int op_rdg;
long unsigned int cl_rdg;
long unsigned int met_calls;
long unsigned int free_calls;
long unsigned int charge_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 int net_amt_aft;
bar(0,0,679,679);
setcolor(BROWN);
| P a g e 24
outtextxy(100,150,"ENTER THE 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,sizeof(g1));
if(fin.eof())
{
setfillstyle(1,LIGHTMAGENTA);
bar(0,0,679,679);
setfillstyle(1,LIGHTCYAN);
bar(40,200,565,250);
setcolor(BLUE);
settextstyle(1,0,3);
outtextxy(70,220,"DESIRED TELEPHONE_NO
DOES NOT EXISTS");
delay(2000);
setfillstyle(1,0);
goto u;
}
if(g1.tel_no==tel_no2)
{
char ch;
long unsigned int b=fin.tellg();
| P a g e 25
long unsigned int s=sizeof(g1);
fin.close();
fin.open("m.dat",ios::out|ios::ate|ios::binary);
fin.seekp(b-s);
setfillstyle(1,LIGHTGRAY);
bar(0,0,680,480);
setlinestyle(0,0,3);
setcolor(BLACK);
settextstyle(1,0,5);
outtextxy(90,20,"ENTER THE RECORD:-");
setfillstyle(1,BLACK);
bar(50,100,550,400);
rectangle(50,100,550,400);
gotoxy(10,10);
cout<<"TELEPHONE NO. :";
cout<<g1.tel_no;
cin.get(ch);
gotoxy(10,12);
cout<<"NAME :";
cin.getline(name,60);
gotoxy(10,14);
cout<<"ADDRESS :";
cin.getline(add,300);
gotoxy(10,16);
cout<<"CITY :";
cin.getline(city,20);
gotoxy(10,18);
cout<<"OPENING READING :";
cin>>op_rdg;
| P a g e 26
gotoxy(10,20);
cout<<"CLOSING READING :";
cin>>cl_rdg;
met_calls=cl_rdg-op_rdg;
free_calls=150;
rent=360;
if(met_calls<free_calls )
{
charge_calls=0;
met_charge=0;
}
else
{
charge_calls=met_calls-free_calls;
met_charge=charge_calls*(.50);
}
gotoxy(10,22);
cout<<"DEBITS :";
cin>>debits;
tax=(rent+met_charge+debits)/20;
gross_amt=(met_charge+rent+tax+debits);
gotoxy(10,24);
cout<<"CREDITS :";
cin>>credits;
if(credits>gross_amt)
net_amt_bef=0;
else
net_amt_bef=gross_amt-credits;
if(credits>=gross_amt)
| P a g e 27
surcharge=0;
else
surcharge=20;
net_amt_aft=net_amt_bef+surcharge;
g1.con_no=g1.con_no;
strcpy(g1.name,name);
strcpy(g1.add,add);
strcpy(g1.city,city);
g1.op_rdg=op_rdg;
g1.cl_rdg=cl_rdg;
g1.met_calls=met_calls;
g1.free_calls=free_calls;
g1.charge_calls=charge_calls;
g1.met_charge=met_charge;
g1.rent=rent;
g1.debits=debits;
g1.tax=tax;
g1.credits=credits;
g1.gross_amt=gross_amt;
g1.surcharge=surcharge;
g1.net_amt_bef=net_amt_bef;
g1.net_amt_aft=net_amt_aft;
fin.write((char*)&g1,sizeof(g1));
goto kk;
}
}while(fin);
kk:setfillstyle(1,LIGHTMAGENTA);
bar(0,0,679,679);
| P a g e 28
setfillstyle(1,LIGHTCYAN);
bar(35,200,550,250);
setcolor(BLUE);
settextstyle(1,0,3);
outtextxy(80,220,"RECORD OF THIS PERSON IS
MODIFIED");
delay(4000);
setfillstyle(1,0);
goto u;
}
//FOR EXIT
else
{
exit(0);
}
u:fin.close();
bar(0,0,680,480);
goto i;
y:setfillstyle(1,LIGHTMAGENTA);
bar(0,0,679,679);
settextstyle(TRIPLEX_FONT,0,3);
setfillstyle(1,LIGHTCYAN);
bar(150,200,490,245);
setcolor(BLUE);
outtextxy(210,220,"RECORD NOT FOUND");
setfillstyle(1,0);
| P a g e 29
fin.close();
delay(2000);
goto u;
}
void proj_name(void)
{ int i,j;
setcolor(CYAN);
setlinestyle(1,0,3);
setfillstyle(1,RED);
bar(2,1,660,660);
rectangle(2,1,660,660);
setcolor(BLUE);
setfillstyle(1,WHITE);
bar(25,75,575,425);
rectangle(25,75,575,425);
setfillstyle(1,RED);
bar(50,100,550,400);
rectangle(50,100,550,400);
setcolor(CYAN);
setfillstyle(1,WHITE);
bar(75,125,525,375);
rectangle(75,125,525,375);
setcolor(CYAN);
setfillstyle(1,RED);
bar(100,150,500,350);
rectangle(100,150,500,350);
setcolor(BLUE);
settextstyle(0,0,1);
| P a g e 30
settextstyle(1,0,6);
settextjustify(CENTER_TEXT,CENTER_TEXT);
for(i=170;i<=172;i++)
{
sleep(1);
outtextxy(291,i, "TELEPHONE");
outtextxy(301,i+70, " BILLING ");
outtextxy(331,i+150,"SYSTEM ");
}
}
void created(void)
{
setfillstyle(1,LIGHTCYAN);
rectangle(2,1,660,660);
bar(2,1,660,660);
setcolor(RED);
setlinestyle(1,0,3);
settextstyle(1,0,8);
settextjustify(LEFT_TEXT,TOP_TEXT);
line(10,110,380,110);
outtextxy(10,20,"C");
settextstyle(4,0,8);
outtextxy(47,20,"reated By:-");
settextstyle(1,0,6);
settextjustify(LEFT_TEXT,CENTER_TEXT);
outtextxy(120,200," UDAY AND ABHILASH ");
| P a g e 31
sleep(1);
sleep(1);
clrscr();
}
| P a g e 32
OUTPUTS
BIBLIOGRAPHY:
• Books referred:
| P a g e 33
1. Computer Science Class XII
Sumita Arora
. Websites referred:
1. www.icbse.com
2. www.yahoo.com
| P a g e 34
| P a g e 35