You are on page 1of 28

COMPUTER INVESTIGATORY

PROJECT

TOPIC: TELEPHONE BILLING MANAGEMENT

MADE BY:-

SWARANGI MHATRE

STD-XII SCIENCE

ROLL NO. -13


CERTIFICATE OF COMPLETION
This is to certify that Swarangi Mhatre of class XII (Science)
has successfully completed the Computer Science
investigatory project on Bus Telephone Billing Management
as prescribed by CBSE for academic session 2018-19.
INDEX

SR TOPIC PAGE NO.


NO.
1. Acknowledgement 1
2. Preface 2
3. Working Description 3
4. Minimum hardware and 4
software requirements

5. The programming language 5


C++
6. Data flow diagram 6
7. Coding 7-15
8. Output 16-23
9. Bibliography 24
ACKNOWLEDGEMENT

As usual a large no. of people deserve my thanks for the


help they provided me for the preparation of this project.

First of all I would like to thank my teacher Mr. Abhivandan


Mehta sir for his support during the preparation of this
project. I am very thankful for his guidance.

I would also like to thanks my friends for the


encouragement and the information about the topic they
provided me during my efforts to prepare this topic.

At last I would also place on record, our sincere gratitude to


one and all who directly or indirectly, have lent their helping
hand in this venture.
Preface
The TELEPHONE BILLING SOFTWARE helps to minimize the use of
paper and it is better to use software instead of paper because
by using software we can get instant result, we can save a lot of
papers. Managing paper is more difficult than to store things on
computer.

The purpose of the project is to present the requirement of the


computerization of TELEPHONE BILLING MANAGEMENT. The
project thus manage the telephone details automatically it does
almost every work which is related to automatic management of
telephone billing via – new telephone detail, updating of detail,
modification of detail, viewing customer record. TELEPHONE
BILLING MANAGEMENT is developed as per seeing the increasing
culture. Thus a new software has been proposed to reduce
manually work, improving work efficiency, saving time and to
provide greater flexibility and user friendliness.
Working description:-

This program is designed to keep the telephone bill


records.
This program consist of SIX options as follows:-

1. To add new telephone record


2. To see all records
3. For enquiry
4. To modify record
5. To delete record
6. To exit
MINIMUM HARDWARE AND SOFTWARE

REQUIREMENTS

Operating System: - Windows XP, Vista, 7.

Processor: - Pentium III/1.4GHz Processor.

RAM: - 512MB.

Hard Disk Space: - 10.2 GB space required.

Software required: - Turbo C++.


INTRODUCTION To C++
C++ is a programming Language Developed by Bjarne Stroustrup. It was
originally named as C with classes, was renamed as C++ in 1983.It is
regarded as an intermediate-level language, as it comprises both high-
level and low-level language features. Its application domains include
system software, application software, device drivers, embedded
software, high-performance server and client applications, and
entertainment software such as video games. C++ continues to be used
and is one of the preferred programming languages to develop
professional applications .C++ includes several operators such as
comparison, arithmetic, bit manipulation, logical operators etc. One of
the most attractive features of C++ is that it enables the overloading of
certain operators such as addition.

A few of the essential concepts within C++ programming language include


polymorphism, virtual and friend functions, templates, name spaces and
pointers.

For a time, C++ had no official standard and was maintained by a de- facto
standard, however since 1993, C++ is standardized by a committee of the
ISO.

C++ compiles directly to a machine's native code, allowing it to be one of


the fastest languages in the world, if optimized. C++ also supports both
static and dynamic type checking.

C++ allows type conversions to be checked either at compile-time or at


run-time, again offering another degree of flexibility. Most C++
typechecking is, however, static.
Data FLOW
DIAGRAM
TELEPHONE BILLING SYSTEM
OPTIONS

3. Add Record 2. Enquiry 1. Delete

5. See Record 4. To Modify 6. Exit

Enter Enter Enter


Telephone No. Telephone No. Telephone No.

OUT OF PROGRAM
Enter
Telephone No.

RECORD ADDED SHOW DETAILS SHOW DETAILS

No. does not exist RECORD DELETED


No. already exist

No. does not exist


SHOW DETAILS
SHOW RECORD

File does not exist ENTER NEW RECORD

No. does not exist


Coding

#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
#include<dos.h>

class tel_bil
{
private:

int calls;
char name[100],adrs[100];
char city[30];

public:

char tel_no[15];
long unsigned int cons_no;
void show_data();
void get_data();

};

fstream file;

void tel_bil::get_data()
{

char ch;
cin.get(ch);
cout<<"\n\tENTER NAME: ";
cin.getline(name,30);
cout<<"\n\tENTER ADDRESS: ";
cin.getline(adrs,100);
cout<<"\n\tENTER CITY: ";
cin.getline(city,40);
cout<<"\n\tENTER TOTAL NO. OF CALLS: ";
cin>>calls;

void tel_bil::show_data()
{

float tax=0.02;
float charge;
int n;
char ch;

if(calls>=50)
{
n=calls-50;
tax=tax*n;
charge=tax+(2*n)+60;
}
else
{
n=0;
tax=0;
charge=60;
}

cout<<"\n\t\t\tBHARAT SANCHAR NIGAM LIMITED";


cout<<"\n\t\t\t\t\tPOSTPAID";
cout<<"\n\n\t\t\t _";
cout<<"\n\tTELEPHONE NO.: "<<tel_no;
cout<<"\n\tCONSUMER NO.: "<<cons_no;
cout<<"\n\tCONSUMER NAME: ";
cout<<name;
cout<<"\n\tADDRESS: ";
cout<<adrs;
cout<<"\n\tCITY: ";
cout<<city;
cout<<"\n\tTOTAL NO. OF CALLS: ";
cout<<calls;
cout<<"\n\tFREE CALLS :"<<"50";
cout<<"\n\tCHARGEABLE CALLS: "<<n;
cout<<"\n\tTAX (2%):"<<tax;
cout<<"\n\tCHARGE PER CALL: "<<"Rs.2";
cout<<"\n\tADDITIONAL CHARGES: Rs. 60";
cout<<"\n\tTOTAL CHARGES: "<<charge;

void main()
{

clrscr();
tel_bil a;
int choice;
char ch;
cout<<"\n\n\n\t\t\tWELCOME TO THE PROJECT";
cout<<"\n\t\t ";
cout<<"\n\n\t\t\tTELEPHONE BILLING SYSTEM";
cout<<"\n\t\t ";
delay(2000);

while(1)
{
clrscr();
cout<<"\n\t\t\t\tOPTIONS";
cout<<"\n\t1. TO ADD NEW RECORD"<<"\n\t2. TO SEE
RECORD"<<"\n\t3. FOR ENQUIRY"
<<"\n\t4. TO MODIFY RECORD"<<"\n\t5. TO DELETE"<<"\n\t6. QUIT";
cout<<"\n\n\tENTER YOUR CHOICE: ";
cin>>choice;
clrscr();

if(choice==1) //to add record


{
char no[15];
int flag;
long unsigned int p,q;

file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);

cout<<"\n\tENTER TELEPHONE NO.: ";


cin.get(ch);
cin.getline(no,15);
file.seekg(0);
flag=0;

do
{
file.read((char*)&a,sizeof(a));
if(strcmp(a.tel_no,no)==0)
{
cout<<"\n\n\t\tTHIS TELEPHONE NO. ALREADY EXIST .......... ";
flag=1;
getch();
break;
}
}while(!file.eof());

file.close();

if(flag==0)
{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);

file.seekp(0,ios::end);
p=file.tellp();
q=(p/sizeof(a))+1;
strcpy(a.tel_no,no);
a.cons_no=q;
a.get_data();
file.write((char*)&a,sizeof(a));
cout<<"\n\n\t\tRECORD ADDED. ............. ";
file.close();
getch();
}
}

else if(choice==2) //to see record


{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);

file.seekg(0);
int t=0;

while(file.read((char*)&a,sizeof(a)))
{
t=1 ;
cout<<"\n\n";
a.show_data();
getch();
}

if(t==0)
{
cout<<"\n\n\t\tFILE DOES NOT EXIST ............. ";
getch();
}
file.close();
}

else if(choice==3) //for enquiry


{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);
char no1[15];
int i=0;
cout<<"\n\n\t\tENTER THE TELEPHONE NO.: ";
cin.get(ch);
cin.getline(no1,15);
file.seekg(0);

do
{
file.read((char*)&a,sizeof(a));

if(strcmp(a.tel_no,no1)==0)
{
a.show_data();
i=1;
getch();
break;
}

}while(!file.eof());

if(i==0)
{
cout<<"\n\n\t\tTHIS TELEPHONE NO. DOES NOT EXIST ......... ";
getch();
}
file.close();
}

else if(choice==4) // for modification


{
long unsigned int b;
int s=0;

file.open("tel.dat",ios::in|ios::binary|ios::out);

char no2[15],no3[15];
file.seekg(0);
cout<<"\n\n\t\tENTER THE TELEPHONE NO. TO BE MODIFIED: ";
cin.get(ch);
cin.getline(no2,15);

while(file.read((char*)&a,sizeof(a)) && s==0)


{
if(strcmp(a.tel_no,no2)==0)
{
a.show_data();
getch();
clrscr();
cout<<"\n\t\t\tENTER NEW RECORDS";
cout<<"\n\n\t\tENTER TELEPHONE NO.: ";
cin.getline(no3,15);
strcpy(a.tel_no,no3);
a.get_data();
int pos=-1*sizeof(a);
file.seekp(pos,ios::cur);
file.write((char*)&a,sizeof(a));
cout<<"\n\n\t\t RECORD UPDATED. .......... ";
s=1;
delay(1000);
break;
}
}

if(s==0)
{
cout<<"\n\n\t\tNO. NOT FOUND. ...... " ;
getch();
}
file.close();
}

else if(choice==5) //to delete


{
char no[15];
int k=0;
cout<<"\n\n\t\tENTER THE TELEPHONE NO. YOU WANT TO DELETE: ";
cin.get(ch);
cin.getline(no,15);

file.open("tel.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);

file.seekg(0,ios::beg);
fp2.seekg(0,ios::beg);

while(file.read((char*)&a,sizeof(a)))
{
if(strcmp(a.tel_no,no)==0)
{
a.show_data();
k=1;
cout<<"\n\n\t\tRECORD DELETED ....... ";
}
else
fp2.write((char*)&a,sizeof(a));
}

fp2.close();
file.close();

if(k==0)
{
cout<<"\n\n\t\tNO. NOT FOUND. ......";
}
remove("tel.dat");
rename("Temp.dat","tel.dat");

getch();
clrscr();
}

else if(choice==6) //exit


exit(0);

else
{
cout<<"\n\n\t\tWRONG CHOICE .... ";
delay(1000);
}
}
}
Output
1. Welcome Screen

2. Menu
3. To Add Record

4. To See Record
IF FILE tel.dat DOES NOT EXIST

5. For Enquiry
IF NO. DOES NOT EXIST

6. To Modify Record
IF NO. DOES NOT EXIST
7. To Delete Record

IF NO. DOES NOT EXIST


8. To Exit

9. If User Entered Wrong Choice


BIBLIOGRAPHY

a. BOOKS
1. Computer science with C++ by Sumita
Arora

B. websites
1. www.google.com
2. wikipedia

You might also like