Wednesday, June 27, 2012

Telecom Billing Management System in c with source code

This Mini project is compile in gcc compiler with code::blocks IDE. This project can be a good reference for those student who are doing there school project in c.Architecture of this project is very simple and easy to understand the code. Just file handling is used to store the data and corresponding function are made to manipulate the data.
The tasks provide in this program are:-
1. A : for adding new records.
2. L : for list of records.
3. M : for modifying records.
4. P : for payment.
5. S : for searching records.
6. D : for deleting records.
User are provide the above tasks.They can add records,modify and view records. Searching and deleting facilities is also provided.

Download Project from GitHub




Here is the complete source code , copy and compile it in code::blocks.You can also download the project form below
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<windows.h>
#include<stdlib.h>
struct subscriber
{
char phonenumber[20];
char name[50];
float amount;
}s;
void addrecords();
void listrecords();
void modifyrecords();
void deleterecords();
void searchrecords();
void payment();
char get;
int main()
{  int password;
  int phonenumber;
  char choice;



  system("cls");

  printf("\n\n\n\n\n\n\n\n\n**********************************************************************");
  printf("\n\t\t---WELCOME TO THE TELECOM BILLING MANAGEMENT SYSTEM---");
  printf("\n\t\t****************************************************************");
  Sleep(2000);
  getch();
    system("cls");
  while (1)
  {
    system("cls");
    printf("\n enter\n A : for adding new records.\n L : for list of records");
    printf("\n M : for modifying records.\n P : for payment");
    printf("\n S : for searching records.");
    printf("\n D : for deleting records.\n E : for exit\n");
    choice=getche();
    choice=toupper(choice);
    switch(choice)
    {
      case 'P':
        payment();break;
      case 'A':
        addrecords();break;
      case 'L':
        listrecords();break;
      case 'M':
        modifyrecords();break;
      case 'S':
        searchrecords();break;
      case 'D':
        deleterecords();break;
      case 'E':
        system("cls");
        printf("\n\n\t\t\t\tTHANK YOU");
        printf("\n\n\n\n\n:\n\tFOR USING OUR SERVICE");
        Sleep(2000);
        exit(0);
        break;
      default:
        system("cls");
        printf("Incorrect Input");
        printf("\nAny key to continue");
        getch();
    }
  }
}
void addrecords()
{
  FILE *f;
  char test;
  f=fopen("c:/file.ojs","ab+");
  if(f==0)
  {   f=fopen("c:/file.ojs","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("%[^\n]",&s.name);
    printf("\n Enter amount:");
    scanf("%f",&s.amount);
    fwrite(&s,sizeof(s),1,f);
    fflush(stdin);
    system("cls");
    printf("1 record successfully added");
    printf("\n Press esc key to exit, any other key to add other record:");
    test=getche();
    if(test==27)
      break;
  }
  fclose(f);
}
void listrecords()
{
  FILE *f;
  int i;
  if((f=fopen("c:/file.ojs","rb"))==NULL)
    exit(0);
  system("cls");
  printf("Phone Number\t\tUser Name\t\t\tAmount\n");
  for(i=0;i<79;i++)
    printf("-");
  while(fread(&s,sizeof(s),1,f)==1)
  {
    printf("\n%-10s\t\t%-20s\t\tRs. %.2f /-",s.phonenumber,s.name,s.amount);
  }
  printf("\n");
  for(i=0;i<79;i++)
    printf("-");

fclose(f);
getch();
}
void deleterecords()
{
  FILE *f,*t;
  int i=1;
  char phonenumber[20];
  if((t=fopen("c:/temp.ojs","w+"))==NULL)
  exit(0);
  if((f=fopen("c:/file.ojs","rb"))==NULL)
  exit(0);
  system("cls");
  printf("Enter the phone number to be deleted from the Database");
  fflush(stdin);
  scanf("%[^\n]",phonenumber);
  while(fread(&s,sizeof(s),1,f)==1)
  {
    if(strcmp(s.phonenumber,phonenumber)==0)
    {       i=0;
      continue;

    }
    else
      fwrite(&s,sizeof(s),1,t);
  }
  if(i==1)
  {       system("cls");
    printf("Phone number \"%s\" not found",phonenumber);
    remove("c:/file.ojs");
    rename("c:/temp.ojs","c:/file.ojs");
    getch();
    fclose(f);
    fclose(t);
    main();
  }
  remove("c:/file.ojs");
  rename("c:/temp.ojs","c:/file.ojs");
  system("cls");
  printf("The Number %s Successfully Deleted!!!!",phonenumber);
  fclose(f);
  fclose(t);
  getch();
}
void searchrecords()
{
  FILE *f;
  char phonenumber[20];
  int flag=1;
  f=fopen("c:/file.ojs","rb+");
  if(f==0)
    exit(0);
  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);
{
}
void modifyrecords()
  FILE *f;
  char phonenumber[20];
  long int size=sizeof(s);
  if((f=fopen("c:/file.ojs","rb+"))==NULL)
    exit(0);
  system("cls");
  printf("Enter phone number of the subscriber to modify:");
  scanf("%[^\n]",phonenumber);
  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);
}
void payment()
{
  FILE *f;
  char phonenumber[20];
  long int size=sizeof(s);
  float amt;
  int i;
  if((f=fopen("c:/file.ojs","rb+"))==NULL)
    exit(0);
  system("cls");
  printf("Enter phone number of the subscriber for payment");
  scanf("%[^\n]",phonenumber);
  fflush(stdin);
  while(fread(&s,sizeof(s),1,f)==1)
  {
    if(strcmp(s.phonenumber,phonenumber)==0)
    {
      system("cls");
      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);
  getch();
      fwrite(&s,sizeof(s),1,f);
      break;
    }
  }
  system("cls");
  printf("THANK YOU %s FOR YOUR TIMELY PAYMENTS",s.name);
  fclose(f);
}




This project is created by Abir.

You can download the project form here.

Download Telecom Billing system

19 comments:

  1. Great, I also found useful site that contains FREE SYSTEM + DOCUMENTATION

    SITE: free-thesis-programs.blogspot.com

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Can you pls send me the program in Turbo C Compiler here is my Email Add.(bogasofour@gmail.com)

    ReplyDelete
  5. May I have your permission to use your codes on my site? I am studying c right now and the codes will be used for educational purpose, not for commercial use. Thanks. Elena Quackenbush.

    ReplyDelete
    Replies
    1. Sure you can distributed any where and use in anythings.

      Delete
  6. How can I convert it to fortran language ,,,,
    could somebody do it for me please ,,,,
    here is my email
    ( al_man110@yahoo.com)

    ReplyDelete
  7. how will i get output of this program ,,,??? is anyone here right now so plz tell me ??
    and give me plz plz plz plz

    ReplyDelete
  8. please provide the doccumentation for this project n existed system n also proposed system..

    ReplyDelete
  9. please provide what is its benefits




    ReplyDelete
    Replies
    1. Can i have a deep explanation about telecom biling management c code pls

      Delete
    2. It is very easy. Simple to understand.

      Delete
  10. can anyone help me with a mini project in C with report
    .. i want it by tommorow.. plz
    if anyone der den help me...
    i wish u have the report too .
    frnds msg me here or on cse11421.sbit@gmail.com
    plzzz... i really need this.. it will be really helpful to me

    ReplyDelete
  11. can i get this project in txt file plzz cuz i need to submit a project related to text file i haven't done binary yet :/

    ReplyDelete
  12. can any one help me for this
    The following data is some information about Mr Ahmad credit card. The data is store in a file, name mycard.txt.
    VISA cimb 2011
    VISA maybank 2010
    Masters rakyat 2015
    Amex islam 2010
    Dinners public 2009
     Help Mr Ahmad to develop a program that can store and retrieve the information about his credit card.
     Declare a structure to store the information with structure name cardinfo.
     The data member of the structure is cardname, bankname and expiry.
     Initialize card1 to take the data members of the structure cardinfo.
     Open and read the input in the data file.
     Check either the input file is in the same directory as the code or not.
     Initialize the input to card1

    ReplyDelete
  13. i am presently using 16.01 version of code blocks and i got 23 errors!!! can u suggest some other code suitable for 13.12 and also for 16.01 plz???
    and my emailid is goutambharadwajm@gmail.com plz mail the code 13.12 version and for 16.01 version plz do me a favour in this accord.

    ReplyDelete
  14. record is not deleted in this peoject

    ReplyDelete