0% found this document useful (0 votes)
49 views

CS Project Final

The document describes a student project on a telephone billing system. It includes an introduction, hardware and software requirements, coding details across multiple pages, and sample outputs. The project allows users to add, view, modify and delete telephone records and generate bills.

Uploaded by

preeti gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

CS Project Final

The document describes a student project on a telephone billing system. It includes an introduction, hardware and software requirements, coding details across multiple pages, and sample outputs. The project allows users to add, view, modify and delete telephone records and generate bills.

Uploaded by

preeti gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Name: ARIHANT MAHAJAN

Class: XII

COMPUTER SCIENCE PROJECT

Topic: Telephone Billing System

School: VENKATESHWAR INTERNATIONAL


SCHOOL
CERTIFICATE

This is to certify that the COMPUTER SCIENCE project on


“TELEPHONE BILLING SYSTEM” has been successfully completed by
Arihant Mahajan of class XII in partial fulfilment of curriculum
of CENTRAL BOARD OF SECONDARY EDUCATION (CBSE) of
Computer Science (083) leading to the award of AISSCE Practical
Examination 2019-20.

Ms. Meenu Kumar Board Examiner


INDEX

SR TOPIC PAGE NO.


NO.
1. Acknowledgement 1
2. Preface 2
3. Working Description 3
4. Minimum hardware and
software requirements 4
5. 5-13
Coding

6. 14-22
Output
7. Bibliography
23
ACKNOWLEDGEMENT

As usual a large number 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 Ms. Meenu Kumar


for her support during the preparation of this project. I am very
thankful for her guidance.

I would also like to thank my friends for the encouragement and


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

I would also like to thank my parents for constantly motivating


me to work hard and diligently on this project.

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++.


Coding
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.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______________________________________";

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 Preeti
Arora
2. Object Oriented Programming with C++
By Balagurusamy

B. Websites
1. www.google.com
2. Wikipedia

You might also like