Telecom Billing System: Pragallath P.S
Telecom Billing System: Pragallath P.S
A PROJECT REPORT
Submitted by
PRAGALLATH P.S
er No: 18P328
GOWTHAM .S
er No: 18P313
PRASHANTH.S
er No: 18P329
DATA STRUCTURES LABORATORY
(III SEMESTER)
OCTOBER 2019
CERTIFICAT
E
Certified that this project report titled “TELECOM BILLING SYSTEM” is the
further, that to the best of my knowledge the work reported herein does not form
I understand the policy on plagiarism and declare that the project and publications
are my own work, except where specifically acknowledged and has not been
copied from other sources or been previously submitted for award or assessment.
Examiner I Examiner
Telecom Billing System Page |3
ABSTRACT
2 REQUIREMENTS SPECIFICATION
4 ALGORITHM DESIGN
3.1 ALGORITHM
5 SOURCE CODE
7 CONCLUSION
8 BIBLIOGRAPHY
Telecom Billing System Page |5
1 PROBLEM DEFINITION
The main objective while implementing the project Telephone Billing System were to
minimize the work and at the same time increase the speed of the work done.
2 REQUIREMENT SPECIFICATION
RAM : 128 MB
Language : C
A file is a collection of records. This is a loose definition of a file. Almost all of the data
structures discussed in the preceding chapters satisfy it. The term file, however, is usually
reserved for large collections of information stored on devices outside the computer's internal
memory. It usually implies that the records are stored in secondary storage in the computer's
external memory, on tapes or disks. As a result, the ways in which the file must be organized so
that operations on it can be carried out efficiently are dependent on the characteristics of the
secondary storage devices used to implement the file. The basic operations on a file are to insert
and delete records, process or update records, and search for or retrieve records. These
operations are the same as the basic operations on arrays, lists, trees, list-structures, and more
complex lists, which are stored in the computer's internal memory. In designing algorithms that
use files stored in external memory, programmers must weigh the trade-offs between the time
and the storage required to support these operations. They must do this just as they would for
data structures stored in internal memory. Time spent in organizing information results in faster
operations, but this efficiency must be weighed against the increased care required to nurture
and maintain the better-organized data structure. For example, balanced trees are faster to use in
the worst case but harder to grow. Similar effects pertain to file manipulations.
Telecom Billing System Page |8
Applications
File organization ensures that records are available for processing. It is used to determine
an efficient file organization for each base relation..
Storing and sorting in contiguous block within files on tape or disk is called as sequential
access file organization.Language processing:
Direct access file helps in online transaction processing system (OLTP) like online
railway reservation system
In indexed sequential access file, sequential file and random file access is possible.
Telecom Billing System Page |9
4 ALGORITHM DESIGN
4.1 ALGORITHM
Insert()
remove()
check if list is NULL
if yes print pending payment to remove
assign p=list;
assign list=list->next;
print all details in record
display()
assign p=list;
check if p is NULL
if yes print no record to display
initialize loop
print all record details in database
currentTotal()
check if list is NULL
if yes print no cart to remove
initialize loop
calculate cost of product
print the details of product with cost
print total cost of cart
Telecom Billing System P a g e | 10
5 SOURCE CODE
#include<stdio.h>
#include<stdlib.h>
struct subscriber
{
char phonenumber[20];
char name[50];
float amount;
}s;
void gotoxy(int,int);
void addrecords();
void listrecords();
void modifyrecords();
void deleterecords();
void searchrecords();
void payment();
void login();
char get;
int main()
{
int phonenumber;
char choice;
system("cls");
system("cls");
printf("\t\t**************************************************************
**");
printf("\n\t\t ------WELCOME TO THE TELECOM BILLING MANAGEMENT
SYSTEM------");
printf("\n\t\t************************************************************
****");
printf("\n\n\n\t\t Press Any Key To Continue. . ");
getch();
system("cls");
system("cls");
printf("\n\n\xDB\xDB\xDB\xDB\xDB TELECOM BILLING SYSTEM
\xDB\xDB\xDB\xDB\xDB");
while (1){
printf(" \n\n A : Add New Records.\n\n \xDB\xDB 2 : List Of
Records");
printf("\n\n M : Modify Records.\n\n \xDB\xDB 4 : For
Payment");
printf("\n\n S : Search Records.");
printf("\n\n D : Delete Records.\n\n E : Exit\n");
printf("\n Enter Your Choice:-");
choice=getche();
choice=toupper(choice);
Telecom Billing System P a g e | 11
switch(choice)
{
case 'A':
addrecords();break;
case 'L':
listrecords();break;
case 'M':
modifyrecords();break;
case 'P':
payment() ;break;
case 'S':
searchrecords() ;break;
case 'D':
deleterecords();break;
case 'E':
system("cls");
exit(0);
break;
default:
system("cls");
printf("Incorrect Input");
printf("\a......");
printf("Any key to continue");
getch();
}
}
}
void addrecords()
{
FILE *f;
char test;
f=fopen("pro.txt","ab+");
if(f==0)
{ f=fopen("pro.txt","wb+");
system("cls");
printf("Please wait while we configure your computer");
printf("\npress any key to continue");
getch();
}
while(1)
{
system("cls");
printf("\n Enter phone number: ");
scanf("%s",&s.phonenumber);
printf("\n Enter name: ");
fflush(stdin);
scanf("%s",&s.name);
printf("\n Enter amount: ");
scanf("%f",&s.amount);
fwrite(&s,sizeof(s),1,f);
fflush(stdin);
printf("\n\n Record Is Successfully Added");
printf("\n Press esc Key to exit or Press any other key to add
other record:");
Telecom Billing System P a g e | 12
test=getche();
if(test==27)
break;
}
fclose(f);
system("cls");
}
void listrecords()
{
FILE *f;
int i;
if((f=fopen("pro.txt","rb"))==NULL)
exit(0);
system("cls");
printf("Phone Number\t\tUser Name\tAmount\n");
for(i=0;i<79;i++)
printf("-");
while(fread(&s,sizeof(s),1,f)==1)
{
printf("\n%s\t\t%s\t\tRs.
%.2f /-",s.phonenumber,s.name,s.amount);
}
printf("\n");
for(i=0;i<79;i++)
printf("-");
fclose(f);
printf("\n\nPress Any Key To Go Back");
getch();
system("cls");
}
void deleterecords()
{
FILE *f,*t;
char phonenumber[20];
system("cls");
f=fopen("pro.txt","rb+");
t=fopen("pro1.txt","wb+");
do{
rewind(f);
printf("Enter the phone number to be deleted from the Database: ");
scanf("%s",phonenumber);
while(fread(&s,sizeof(s),1,f)==1)
{
if(strcmp(s.phonenumber,phonenumber)!=0)
{ fwrite(&s,sizeof(s),1,t);
}
else
printf("Record deleted successfully.");
}
fclose(f);
fclose(t);
Telecom Billing System P a g e | 13
remove("pro.txt");
rename("pro1.txt","pro.txt");
f=fopen("pro.txt","rb+");
t=fopen("pro1.txt","wb+");
printf("\nDo you want to delete another record (y/n):");
fflush(stdin);
}
while(getche()=='y'||getche()=='Y');
fclose(f);
getch();
system("cls");
}
void searchrecords()
{
FILE *f;
char phonenumber[20];
int flag=1;
f=fopen("pro.txt","rb+");
fflush(stdin);
system("cls");
printf("Enter Phone Number to search in our database: ");
scanf("%s", phonenumber);
while(fread(&s,sizeof(s),1,f)==1)
{
if(strcmp(s.phonenumber,phonenumber)==0)
{ system("cls");
printf(" Record Found ");
printf("\n\nPhonenumber: %s\nName: %s\nAmount: Rs.
%0.2f\n",s.phonenumber,s.name,s.amount);
flag=0;
break;
}
else if(flag==1)
{ system("cls");
printf("Requested Phone Number Not found in our
database");
}
}
getch();
fclose(f);
system("cls");
}
void modifyrecords()
{
FILE *f;
char phonenumber[20];
long int size=sizeof(s);
if((f=fopen("pro.txt","rb+"))==NULL)
exit(0);
system("cls");
printf("Enter phone number of the subscriber to modify: ");
scanf("%s",phonenumber);
Telecom Billing System P a g e | 14
fflush(stdin);
while(fread(&s,sizeof(s),1,f)==1)
{
if(strcmp(s.phonenumber,phonenumber)==0)
{
system("cls");
printf("\n Enter phone number: ");
scanf("%s",&s.phonenumber);
printf("\n Enter name: ");
fflush(stdin);
scanf("%[^\n]",&s.name);
printf("\n Enter amount: ");
scanf("%f",&s.amount);
fseek(f,-size,SEEK_CUR);
fwrite(&s,sizeof(s),1,f);
break;
}
}
fclose(f);
system("cls");
}
void payment()
{
FILE *f;
char phonenumber[20];
long int size=sizeof(s);
float amt;
int i;
if((f=fopen("pro.txt","rb+"))==NULL)
exit(0);
system("cls");
printf("Enter phone number of the subscriber for payment: ");
scanf("%s",phonenumber);
fflush(stdin);
while(fread(&s,sizeof(s),1,f)==1)
{
if(strcmp(s.phonenumber,phonenumber)==0)
{
printf("\n ***DETAILS***");
printf("\n Phone No.: %s",s.phonenumber);
printf("\n Name: %s",s.name);
printf("\n Current amount: %f",s.amount);
printf("\n");
for(i=0;i<79;i++)
printf("-");
printf("\n\nEnter amount of payment: ");
fflush(stdin);
scanf(" %f",&amt);
s.amount=s.amount-amt;
fseek(f,-size,SEEK_CUR);
fwrite(&s,sizeof(s),1,f);
break;
}
}
Telecom Billing System P a g e | 15
printf("\n\n");
printf("System Message: THANK YOU %s FOR YOUR TIMELY
PAYMENTS!!",s.name);
getch();
fclose(f);
system("cls");
}
Description:
As we add the items to the cart the price of the items are calculated and displayed.
Telecom Billing System P a g e | 16
7 CONCLUSION
Our project is a humble venture to satisfy the need of customer who do the online
shopping.. Several user friendly coding have also adopted. This package shall prove to be a
powerful package in satisfying all the requirements of the customer as well as organization.
The objective of software planning is to provide a frame work that enables the
manger to make reasonable estimates made within a limited time frame at the beginning of the
software project and should be updated regularly as the project progresses.
8 BIBLIOGRAPHY
1) http://www.tutorialspoint.com/cplusplus/
4) http://scanftree.com/Data_Structure/