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

Computer Science

This document is a project file submitted for a telephone billing system project. It includes a certificate signed by internal and external examiners, an acknowledgement of guidance from a teacher, hardware and software specifications used in developing the program, and an outline of the project contents which describes functions for adding, modifying, deleting, displaying, and generating bills for customer accounts. The source code implements these functions using classes, files for input/output, and other programming elements.

Uploaded by

Jay Mandal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Computer Science

This document is a project file submitted for a telephone billing system project. It includes a certificate signed by internal and external examiners, an acknowledgement of guidance from a teacher, hardware and software specifications used in developing the program, and an outline of the project contents which describes functions for adding, modifying, deleting, displaying, and generating bills for customer accounts. The source code implements these functions using classes, files for input/output, and other programming elements.

Uploaded by

Jay Mandal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 46

COMPUTER SCIENCE

PROJECT FILE

SUBMITTED TO: SUBMITTED BY:


CENTRAL BOARD OF ABHAY PANDEY
SECONDARY EDUCATION XII A3
Guided by cope for improvement
MR. AMIT KHUSWAHA
H.O.D. COMPUTER SCIENCE
certificate

This is to certify that project entitled “Telephone Billing


System” has been successfully carried out by “Abhay
Pandey” under my supervision and guidance in partial
Fulfilment of Class XII practical exam for Central Board
Of Secondary Education (CBSE) in the session 2015-16.

Signature of Internal Signature of External


Examiner Examiner

__________________
acknowledgement

It is matter of great pleasure for me to present my project


report on
“Telephone Billing System”

I consider it a great privilege to express my deep sense of


gratitude to my subject teacher Mr. Amit Khuswaha for his
guidance, encouragement, assistance, stained & keen
interest during tenure of my project. Without his motivation
and help the successful completion of this project would not
have been possible.

-Abhay Pandey
Hardware and Software
Specifications:
The program is developed on Intel i3 processor with 2GB
RAM, Window 7 operating system. Compiler used turbo
C++ vr.2.3
Minimum hardware requirements:
Processor: Pentium III
Ram: 512 MB
Hard disk: 20 GB.
Inject Printer, to print the required documents of the
Project
Compact Drive
Software requirements:
Operating system: Windows XP
Ms Word, for presentation of output.
Borland C++ vr.6.3, for execution of program.
Content At Glance

1. Abstract
2. Class DESCRIPTION
3. How To Invoke System
4. Source Code
5. Output
6. Scope For Improvement
7. Bibliography
Abstract:

The following program is based upon the Telephone Billing


System used in different call centres. In this person is allowed to
generate the bills of their users without any manual
work which is saved electronically.

This software provides features to add, delete, modify,


Generate bills and display the details of the customers using
telephone . It stores the
name, address, account no, local,std&ISD calls don by the customer.
And displays all the total amount of bill paid individual user. For
modifying and deleting users details we need to enter the account no.

For exiting the menu there is an exit function also.


Class Description:

It consists functions:
The program consist one class named account with private
data members name,address,account no as acc_no,phone no as
ph_no.

1.void add(): used to add details of new customers


2. void modify(): used to modify the details of a customer
3. void del(): used to delete the of the customer
4. void display(): used to display the details of the customer
5. void generate(): used to generate the bills of the customer
6. void help(): used to displays help documentation to user
How to invoke system?
The void return functions:
1. numdigits():- this returns the number of digits contained in the
passed integer value.
2. mon(): this method converts the month’s value from integer to
string.
3. Account: this is the class releasing the real world entity
customer.
4. Obj:- Of installation of account class , obj is primarily used to
work with the data at hand and update it in the database file.
5. db.dat:- this is the primary database file which stores all the
backened data for the application.

All these functions are invoked by main function.Header


files used are :
1. IOSTREAM.H – for input output operations
2. CONIO.H – for clrscr() and getch() functions
3. STDIO.H – for standard I/O operations
4. STRING.H – for string handling
5. FSTREAM.H – for I/O of binary file
6.PROCESS.H—FOR EXIT ()
Source code:
//**********************************************************
//HEADER FILE USED IN PROJECT
//**********************************************************
#include<iostream.h>
#include<fstream.h>
#include<iomanip.h>
#include<math.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<ctype.h>
#include<dos.h>

//**********************************************************
//CLASS USED IN PROJECT
//**********************************************************

class account
{
char name[30];
char address[60];
long acc_no;
long phone_no;
public:
void add();
void modify();
void del();
void display();
void generate();
void help();

};
account obj;
int bil_ctr=1; //Counter variable for bill id
/*Function for counting number of digits in an integer*/
int numdigits(long n)
{
return(log10(n)+1);
}
/*Function for converting a month’s value from integer to string*/
char *mon(int m)
{
switch(m)
{
case(1):
return(“Jan”);
case(2):
return(“Feb”);
case(3):
return(“Mar”);
case(4):
return(“Apr”);
case(5):
return(“May”);
case(6):
return(“Jun”);
case(7):
return(“Jul”);
case(8):
return(“Aug”);
case(9):
return(“Sep”);
case(10):
return(“Oct”);
case(11):
return(“Nov”);
case(12):
return(“Dec”);
}
}
do
{
clrscr();
gotoxy(30,5);
cout<<“Supreme Telecom Pvt. Ltd.”;
gotoxy(30,6);
cout<<“_________________________”;
gotoxy(30,8);
cout<<“‘A’dd new record”;
gotoxy(30,10);
cout<<“‘M’odify existing record”;
gotoxy(30,12);
cout<<“‘D’elete existing record”;
gotoxy(30,14);
cout<<“‘E’xit”;
gotoxy(30,30);
cout<<“Enter your choice”;
ch2=getch();
ch2=toupper(ch2);
switch(ch2)
{
case(‘A’):
obj.add();
break;
case(‘M’):
obj.modify();
break;
case(‘D’):
obj.del();
break;
case(‘E’):
break;
} //End of inner switch-case block
}while(ch2!=‘E’); //End of do-while block
} //End of outer switch-case block
} //End of while block
} //End of main()

//*Function for adding a new customer record*//


void account :: add()
{
char ch1;
fstream fptr1;
fptr1.open(“db.dat”,ios::app);
if(fptr1.fail())
{
cout<<“Cannot open the db.dat file!”;
getch();
return;
}
clrscr();
gotoxy(30,5);
cout<<“Enter the new customer’s details..”;
while(1)
{
gotoxy(30,8);
cout<<“Name : ”;
gets(name);
if(strlen(name)==0)
{
gotoxy(30,30);
clreol();
cout<<“Name cannot be left blank!”;
}
else
{
gotoxy(30,30);
clreol();
break;
}
}
while(1)
{
gotoxy(30,10);
cout<<“Address : ”;
gets(address);
if(strlen(address)==0)
{
gotoxy(30,30);
clreol();
cout<<“Address cannot be left blank”;
}
else{gotoxy(30,30);
clreol();
break;
}
}
gotoxy(30,30);
cout<<“‘S’ave and Exit”;
gotoxy(30,32);
cout<<“‘E’xit without saving ”;
ch1=getch();
ch1=toupper(ch1);
switch(ch1)
{
case(‘S’):
fptr1.write((char *)this,sizeof(obj));
fptr1.close();
return;
case(‘E’):
fptr1.close();
return;
}
} //End of add()
//*Function for modifying a customer record*//

void account :: modify()


{
char ch;
long input_no;
int flag=0;
fstream fptr1,fptr2;
fptr1.open(“db.dat”,ios::in);
if(fptr1.fail())
{
cout<<“Cannot open the db.dat file!”;
getch();
return;}
fptr2.open(“dbtemp.dat”,ios::out);
if(fptr2.fail())
{
cout<<“Cannot open the dbtemp.dat file!”;
getch();
return;
}
clrscr();
gotoxy(20,3);
cout<<“Enter the phone no whose record is to be modified: ”;
cin>>input_no;
while(fptr1.read((char *)this, sizeof(obj)))
{
if(input_no==phone_no)
{
flag=1;
gotoxy(20,5);
cout<<“Name”<<name;
gotoxy(20,6);
cout<<“Address” << address;
gotoxy(20,7);
cout<<“Acc No”<<acc_no;
gotoxy(20,10);
cout<<“Modify this customer record (Y/N) ”;
ch = getch();
ch=toupper(ch);
if(ch==‘Y’)
{
gotoxy(20,14);
cout<<“Enter the customer’s modified details..”;
while(1)
{
gotoxy(20,16);
cout<<“Name : ”;
gets(name);
if(strlen(name)==0)
{
gotoxy(30,30);
clreol();
cout<<“Name cannot be left blank!”;
}
else
{
gotoxy(30,30);
clreol();
break;
}
}
while(1)
{
gotoxy(20,18);
cout<<“Address: ”;
gets(address);
if(strlen(address)==0)
{
gotoxy(30,30);
clreol();
cout<<“Address cannot be left blank”;
}
else
{
gotoxy(30,30);
clreol();
break;
}
}
while(1)
{
gotoxy(20,20);
cout<<“Ph. No : ”;
cin>>phone_no;
if(numdigits(phone_no)!=7)
{
gotoxy(44,20);
clreol();
gotoxy(30,30);
clreol();
cout<<“Phone no must be of seven digits”;
}
else
{
gotoxy(30,30);
clreol();
break;}}
fptr1.open(“db.dat”,ios::out);
fptr2.open(“dbtemp.dat”,ios::in);
while(fptr2.read((char *)this,sizeof(obj)))
fptr1.write((char *)this,sizeof(obj));
fptr1.close();
fptr2.close();
}
//****************End of
modify()********************//

//************Function for deleting a customer


record*********//
void account :: del()
{
char ch;
long input_no;
int flag=0;
fstream fptr1,fptr2;
fptr1.open(“db.dat”,ios::in);
if(fptr1.fail())
{
cout<<“Cannot open the db.dat file!”;
getch();
return;
}
fptr2.open(“dbtemp.dat”,ios::out);
if(fptr2.fail())
{
cout<<“Cannot open the dbtemp.dat file!”;
getch();
return;
}
clrscr();
gotoxy(20,3);
cout<<“Enter phone no whose record is to be deleted: ”;
cin>>input_no;
while(fptr1.read((char *)this,sizeof(obj)))
{
if(input_no==phone_no)
{
flag=1;
gotoxy(20,5);
cout<<“Name”<<name;
gotoxy(20,6);
cout<<“Address” <<address;
gotoxy(20,7);
cout<<“Acc No ”<<acc_no;
gotoxy(20,10);
cout<<“Delete this customer record (Y/N) ”;
ch=getch();
ch=toupper(ch);
if(ch==‘N’)
fptr2.write((char *)this,sizeof(obj));
}
else
fptr2.write((char *)this,sizeof(obj));
}
fptr1.close();
fptr2.close();
if(ch==‘N’)
return;
if(flag==0)
{
gotoxy(20,5);
cout<<“Record for telephone number ”<<input_no<<“ does not
exist”;
getch();
return;
}
else
{
gotoxy(20,12);
cout<<“Customer record for ”<<input_no<<“ deleted
successfully”;
getch();
}
fptr1.open(“db.dat”,ios::out);
fptr2.open(“dbtemp.dat”,ios::in);
while(fptr2.read((char *)this,sizeof(obj)))
fptr1.write((char *) this,sizeof(obj));
fptr1.close();
fptr2.close();
}
//**************************End of del()****************//
//**********Function for displaying customer
records*********//
void account :: display()
{
fstream fptr1;
int count;
fptr1.open(“db.dat”,ios::in);
if(fptr1.fail())
{
cout<<“Cannot open the db.dat file!”;
getch();
return;
}
clrscr();
gotoxy(2,2);
cout<<“Name”;
gotoxy(2,3);
cout<<“____”;
gotoxy(30,2);
cout<<“Phone No”;
gotoxy(30,3);
cout<<“_________”;
gotoxy(55,2);
cout<<“Account Number”;
gotoxy(55,3);
cout<<“______________”;
count=4;
while(fptr1.read((char *)this,sizeof(obj)))
{
if(count>=19)
{
gotoxy(30,30);
cout<<“Name cout<<“Press any key to continue”;
getch();
clrscr();
gotoxy(2,2);
gotoxy(2,3);
cout<<“____”;
gotoxy(30,2);
cout<<“Phone No”;
gotoxy(30,3);
cout<<“_________”;
gotoxy(55,2);
cout<<“Account Number”;
gotoxy(55,3);
cout<<“______________”;
count=4;
}
gotoxy(2,count);
cout<<name;
gotoxy(30,count);
cout<<phone_no;
gotoxy(60,count);
cout<<acc_no;
count++;
}
gotoxy(22,30);
cout<<“Press any key to go back the previous menu ”;
getch();
fptr1.close();
}
//**********************End of
display()***********************//

//******************Function for generating telephone


bill******************//

void account :: generate()


{
long input_no;
char choice;
int flag=0;
int lcalls,tcalls,icalls;
float bill,tbill;
float rental=145.82;
int dd,mm,yy;
struct date dat;
getdate(&dat);
dd=dat.da_day;
mm=dat.da_mon;
yy=dat.da_year;
fstream fptr1;
fptr1.open(“db.dat”,ios::in);
if(fptr1.fail())
{
cout<<“Cannot open the db.dat file!”;
getch();
gotoxy(2,32);
cout<<“Total Call Charges”;
gotoxy(65,32);
cout<<setprecision(2);
cout<<bill;
gotoxy(2,33);
cout<<“Monthly Charges :”;
gotoxy(65,33);
cout<<rental;
gotoxy(2,34);
cout<<“Service tax (12.36%):”;
gotoxy(65,34);
cout<<(bill+rental)*0.1236;
tbill=bill+rental+(bill+rental)*0.1236;
gotoxy(2,36);
cout<<“Total charges before ”<<dd<<“ ”<<mon(mm)<<“ ”<<yy;
gotoxy(65,36);
cout<<tbill;
gotoxy(2,37);
cout<<“Total charges after ”<<dd<<“ ”<<mon(mm)<<“ ”<<yy;
gotoxy(65,37);
cout<<tbill+100.00;
gotoxy(55,45);
cout<<“Press any Key to continue”;
getch();
flag=1;
}
}
if(flag==0)
{
gotoxy(2,4);
cout<<“Record for telephone number ”<<input_no<<“ does not
exist”;
getch();
}
fptr1.close();
}
//************************End of generate()************************//
//**************Function for displaying help
documentation******************//
void account :: help()
{
clrscr();
gotoxy(1,2);
cout<<“Telephone Billing System is a command-driven application
that helps manage”;
gotoxy(1,4);
cout<<“records of the customers as well as generate their
telephone bills. ”;
gotoxy(1,8);
cout<<“Press any key to continue...”;
getch();
gotoxy(1,8);
clreol();
gotoxy(15,8);
cout<<“Option”;
gotoxy(15,9);
cout<<“______”;
gotoxy(55,8);
cout<<“Description”;
gotoxy(55,9);
cout<<“___________”;
gotoxy(1,10);
cout<<“‘M’anage Customer Records”;
gotoxy(40,10);
cout<<“Helps to manipulate customer records”;
gotoxy(1,12);
cout<<“ ‘A’dd new record”;
gotoxy(40,12);
cout<<“Adds a new customer record”;
gotoxy(1,14);
cout<<“ ‘M’odify existing record-”;
gotoxy(40,14);
cout<<“Modifies an existing customer record”;
gotoxy(1,16);
cout<<“ ‘D’elete existing record-”;
gotoxy(40,16);
cout<<“Deletes an existing customer record”;
gotoxy(1,18);
cout<<“‘D’isplay list of customers-”;
//**************Function for displaying help
documentation******************//
void account :: help()
{
clrscr();
gotoxy(1,2);
cout<<“Telephone Billing System is a command-driven application
that helps manage”;
gotoxy(1,4);
cout<<“records of the customers as well as generate their
telephone bills. ”;
gotoxy(1,8);
cout<<“Press any key to continue...”;
getch();
gotoxy(1,8);
clreol();
gotoxy(15,8);
cout<<“Option”;
gotoxy(15,9);
cout<<“______”;
gotoxy(55,8);
cout<<“Description”;
gotoxy(55,9);
cout<<“___________”;
gotoxy(1,10);
cout<<“‘M’anage Customer Records”;
gotoxy(40,10);
cout<<“Helps to manipulate customer records”;
gotoxy(1,12);
cout<<“ ‘A’dd new record”;
gotoxy(40,12);
cout<<“Adds a new customer record”;
gotoxy(1,14);
cout<<“ ‘M’odify existing record-”;
gotoxy(40,14);
cout<<“Modifies an existing customer record”;
gotoxy(1,16);
cout<<“ ‘D’elete existing record-”;
gotoxy(40,16);
cout<<“Deletes an existing customer record”;
gotoxy(1,18);
cout<<“‘D’isplay list of customers-”;
gotoxy(1,20);
cout<<“ ‘G’enerate Bill”;
gotoxy(40,20);
cout<<“Helps to generate a telephone bill”;
gotoxy(1,22);
cout<<“ ‘H’elp”;
gotoxy(40,22);
cout<<“Provides help documentation”;
gotoxy(1,24);
cout<<“‘E’xit-”;
gotoxy(40,24);
cout<<“Exits the current screen/application”;
gotoxy(45,45);
cout<<“Press any key to go back..”;
getch();
}

//****************************End of
help()******************************//

//***************************************************************
*****//
//********************End Of
Program***********************************//
//

****************************************************************
****//
Application Output
The Manage Customer record system
Adding Customer Records

Modifying Customer Record


Deleting Customer Records

Generating Telephone Bill


Scope for improvement:

The productivity of the software can be increased by


increasing security and could provide different access for
different users to do specific work only like for a employee worker is
to change the data of record and for a user to only view
bills to be paid. Also, the other authorities can have
right to remove, delete , update software.

Also, it can
The be merged
reliability with different
of software could bedepartments ofwhen
increased as company.
a
wrong or unwanted input is given it gives wrong entry.
The output of software could be made come out in form of
hardcopy or printout, which could also ask for conforming
to print or not. Not only this, the output can be made out
more colourful rather than just black and white.
bibliography

1. Internet
2. Google
3. Computer science With
C++ by Sumita Arora

You might also like