100% found this document useful (1 vote)
527 views12 pages

Custommer Billing System

The document is a project report for a C programming laboratory on a customer billing system. It includes an introduction describing C programming and the objectives of the project. It then details the implementation including the modules, functions, and coding used to create, search, and output customer billing records from a data file using structures. The project allows adding customer accounts, searching by name or number, and viewing billing information.

Uploaded by

lalitha lalli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
527 views12 pages

Custommer Billing System

The document is a project report for a C programming laboratory on a customer billing system. It includes an introduction describing C programming and the objectives of the project. It then details the implementation including the modules, functions, and coding used to create, search, and output customer billing records from a data file using structures. The project allows adding customer accounts, searching by name or number, and viewing billing information.

Uploaded by

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

SETHU INSTITUTE OF TECHNOLOGY

(An Autonomous Institution|


Accredited with ‘A’ Grade by NAAC)
PULLOOR, KARIAPATTI – 626 115.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Academic Year 2019 – 2020 Even Semester

Year: I Semester: II

Project Report

on

19UCS211-C Programming Laboratory

Submitted By,
G. Hilkia Lourdes (2019102048)
S. N. Ishwarya (2019102050)
R. Jawahar Jareena (2019102053)
TABLE OF CONTENTS

S. TITLE PAGE NO

NO

PROBLEM STATEMENT 3

ABSTRACT 3

1. INTRODUCTION

1.1 Introduction 4

1.2 Objective of Project 4

2. IMPLEMENTATION & RESULTS

3.1 List of Modules with description 5

3.2 Coding 6

3.3 Experiments and Results 11

3. CONCLUSION and FUTURE ENHANCEMENT 12

4. REFERENCES 12

2
PROBLEM STATEMENT
Customer Billing System
with
C Programming

ABSTRACT
C programming is a general-purpose, procedural, imperative computer
programming language developed in 1972 by Dennis M. Ritchie at the Bell
Telephone Laboratories to develop the UNIX operating system. C is the most
widely used computer language. It keeps fluctuating at number one scale of
popularity along with Java programming language, which is also equally popular
and most widely used among modern software programmers.

About C Programming
i. Procedural Language - Instructions in a C program are executed step
by step.
ii. Portable - You can move C programs from one platform to another, and
run it without any or minimal changes.
iii. Speed - C programming is faster than most programming languages like
Java, Python, etc.
iv. General Purpose - C programming can be used to develop operating
systems, embedded systems, databases, and so on.

Why C Programming?

❖ C helps you to understand the internal architecture of a computer, how


computer stores and retrieves information.
❖ Opportunity to work on open source projects. Some of the largest open-
source projects such as Linux kernel, Python interpreter, SQLite database,
etc. are written in C programming.

3
1 INTRODUCTION

1.1 Introduction

Customer Billing System Project is a simple console application designed


to demonstrate the practical use of C programming language and its features as
wells as to generate an application which can be used in any departmental store,
shops, cafes etc. for billing to the customer.

You can use this application to keep the records such as name, address,
mobile number, paid amount, due amount, payment date etc. of your regular
costumer. Moreover, if you have a new customer, you can add and edit the
account at any time. The source code of Customer Billing System Project in C
has been written in C programming language without of the use of any graphics.

1.2 Objective of Project

In Customer Billing System, structure has very beautifully used to group the
data type in single unit. The date variables (day, month and year) have been
grouped in the structures named date where as other variables such as name,
number, street, paid amount etc. Customer Billing System application is so
simple to use.
❖ Can add any number of Items
❖ Shows Purchased Date
❖ Structured Base
❖ Proper Layout Design
❖ Real-Time Application

4
2 IMPLEMENTATION & RESULTS

2.1 List of Modules with description

Although graphics has not been used in this project, the application of user
defined functions and structures have been effectively used here. The major user
defined functions used in this C project are:
❖ void input()
❖ void writefile()
❖ void search()
❖ void output()

The function void input() is used to add the new customer account i.e. with the
help of this functions the parameters such as name, address, phone number,
amount paid etc. are asked and entered. Another function void writefile() has
been utilized to create a file on hard disc of computer for storing the information
and data of a customer.
The function void search() has been used to look for previously stored
accounts either by name or by number of the customer. The fourth and the last
user defined function used in this Customer Billing System Project in C is void
output() which has been defined to show the result as console output.
In Customer Billing System, structure has very beautifully used to group the
data type in single unit. The date variables (day, month and year) have been
grouped in the structures named date where as other variables such as name,
number, street, paid amount etc. are grouped under another structure named
account.

5
2.2 Coding

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

void input();
void writefile();
void search();
void output();

struct date{
int month;
int day;
int year;
};

struct account {
int number;
char name[100];
int acct_no;
float mobile_no;
char street[100];
char city[100];
char acct_type;
float oldbalance;
float newbalance;
float payment;
struct date lastpayment;
}customer;
int tl,sl,ts;
void main()
{
int i,n;
char ch;
clrscr();

_setcursortype(_NOCURSOR);
printf(" CUSTOMER BILLING SYSTEM:\n\n");
printf("===============================\n");
printf("\n1: to add account on list\n");
printf("2: to search customer account\n");

6
printf("3: exit\n");
printf("\n================================\n");
do{
printf("\nselect what do you want to do?");
ch=getche();
}while(ch<='0' || ch>'3');
switch(ch){
case '1':
clrscr();
printf("\nhow many customer accounts?");
scanf("%d",&n);
for(i=0;i<n;i++){
input();
if(customer.payment>0)
customer.acct_type=(customer.payment<0.1*customer.oldbalance)? 'O': 'D';
else
customer.acct_type=(customer.oldbalance>0)?'D' : 'C';
customer.newbalance=customer.oldbalance - customer.payment;
writefile();
}
main();
case '2':
clrscr();
printf("search by what?\n");
printf("\n1 --- search by customer number\n");
printf("2 --- search by customer name\n");
search();
ch=getche();
main();
case '3':
clrscr();
delay(700);
textcolor(RED);
gotoxy(25,25);
cprintf("\nA PROJECT BY BIDUR & SUJAN");
delay(1500);
exit(1);
}
}
void input()
{
FILE *fp=fopen("bidur.dat","rb");

7
fseek (fp,0,SEEK_END);
tl=ftell(fp);
sl=sizeof(customer);
ts=tl/sl;
fseek(fp,(ts-1)*sl,SEEK_SET);
fread(&customer,sizeof(customer),1,fp);
printf("\ncustomer no:%d\n",++customer.number);
fclose(fp);
printf(" Account number:");
scanf("%d",&customer.acct_no);
printf("\n Name:");
scanf("%s",customer.name);
printf("\n mobile no:");
scanf("%f",&customer.mobile_no);
printf(" Street:");
scanf("%s",customer.street);
printf(" City:");
scanf("%s",customer.city);
printf(" Previous balance:");
scanf("%f",&customer.oldbalance);
printf(" Current payment:");
scanf("%f",&customer.payment);
printf(" Payment date(mm/dd/yyyy):");
scanf("%d/%d/%d",&customer.lastpayment.month,&customer.lastpayment.da
y,&customer.lastpayment.year);
return;
}
void writefile()
{
FILE *fp;
fp=fopen("bidur.dat","ab");
fwrite(&customer,sizeof(customer),1,fp);
fclose(fp);
return;
}
void search()
{
char ch;
char nam[100];
int n,i,m=1;
FILE *fp;
fp=fopen("bidur.dat","rb");

8
do{
printf("\nenter your choice:");
ch=getche();
}while(ch!='1' && ch!='2');
switch(ch){
case '1':
fseek(fp,0,SEEK_END);
tl=ftell(fp);
sl=sizeof(customer);
ts=tl/sl;
do{
printf("\nchoose customer number:");
scanf("%d",&n);
if(n<=0 || n>ts)
printf("\nenter correct\n");
else{
fseek(fp,(n-1)*sl,SEEK_SET);
fread(&customer,sl,1,fp);
output();
}
printf("\n\nagain?(y/n)");
ch=getche();
}while(ch=='y');
fclose(fp);
break;
case '2':
fseek(fp,0,SEEK_END);
tl=ftell(fp);
sl=sizeof(customer);
ts=tl/sl;
fseek(fp,(ts-1)*sl,SEEK_SET);
fread(&customer,sizeof(customer),1,fp);
n=customer.number;

do{
printf("\nenter the name:");
scanf("%s",nam);
fseek(fp,0,SEEK_SET);
for(i=1;i<=n;i++)
{
fread(&customer,sizeof(customer),1,fp);
if(strcmp(customer.name,nam)==0)

9
{
output();
m=0;
break;
}
}
if(m!=0)
printf("\n\ndoesn't exist\n");
printf("\nanother?(y/n)");
ch=getche();
}while(ch=='y');
fclose(fp);
}
return;
}
void output()
{
printf("\n\n Customer no :%d\n",customer.number);
printf(" Name :%s\n",customer.name);
printf(" Mobile no :%.f\n",customer.mobile_no);
printf(" Account number :%d\n",customer.acct_no);
printf(" Street :%s\n",customer.street);
printf(" City :%s\n",customer.city);
printf(" Old balance :%.2f\n",customer.oldbalance);
printf(" Current payment:%.2f\n",customer.payment);
printf(" New balance :%.2f\n",customer.newbalance);
printf(" Payment
date :%d/%d/%d\n\n",customer.lastpayment.month,customer.lastpayment.day,
customer.lastpayment.year);
printf(" Account status :");
textcolor(128+RED);
switch(customer.acct_type)
{
case 'C':
cprintf("CURRENT\n\n");
break;
case 'O':
cprintf("OVERDUE\n\n");
break;
case 'D':
cprintf("DELINQUENT\n\n");
break;

10
default:
cprintf("ERROR\\n\n");
}
textcolor(WHITE);
return;
}

2.3 Experiments and Results

11
3 CONCLUSION & FUTURE ENHANCEMENT

Customer Billing System application is so simple to use. In order to use the


application, click at the exe file and then, you will have three options to:

❖ To add account
❖ To search account
❖ To exit

Features:

i. It can hold any number of accounts and account can be added to the
program at any time.
ii. The programming of simple calculations such as calculation of due
amount, balance etc. have been embed in the code of project.
iii. The Customer Billing System project in C gives you the facility of
searching the account by two ways, either by name of the customer or by
the number of customer.
iv. The due amount to be paid is shown as negative balance.
v. If you have nothing to do with the program, you can directly exit from the
main menu.

4 REFERENCES

❖ “Programming in Ansi C” – E Balagurusamy


❖ “Computer Fundamentals and Programming in C” – Anita Goel & Ajay
Mittal
❖ https://www.tutorialspoint.com/cprogramming/index.htm
❖ https://www.programiz.com/c-programming

12

You might also like