Computer
Computer
Introduction
Telecom billing system improves the data collection technique and helps the
admins control the billing system well. It has the following advantages:
Telecom billing systems help ensure customer satisfaction.
They help reduce manual errors and aint billing disputes.
They help accelerate payment collections.
They help improve the customer experience.
The telecom billing system so given in the project can do the following tasks:
Add New Record: Add new customer record.
View List of Records: View all the records at a glance.
Modify Record: Modification of an already existing record.
View Payment: View the bill for a given customer.
Delete Record: The deletion of a record from the memory.
Literature review
This project requires you to have a basic understanding of the C
programming language concepts such as arrays, strings, structures, etc. the
consideration of preparation of bill is that for every 1 minute 0.1rs is charged.
The following libraries are used
1. <stdio.h>: For Input and Output
2. <string.h>: For String Manipulation
System design
Implementation
int addRecord()
{
if (customerCount < 100) {
printf("\nEnter name: ");
scanf(" %[^\n]s",
customers[customerCount].name);
printf("Enter phone number: ");
scanf("%s",
customers[customerCount].phoneNumber);
printf("Enter usage (in minutes): ");
scanf("%f", &customers[customerCount].usage);
customers[customerCount].totalBill
= customers[customerCount].usage * 0.1;
customerCount++;
printf("\nRecord added successfully!\n");
}
else {
printf("\nMaximum number of records reached!\
n");
}
return 0;
}
addRecord() is a function to add new customer record. It checks if
the current number of customers given by customerCount is less than
100 ensuring there’s space for a new record. The function prompts the
user to enter the customer’s name, phone number, usage in minutes. It
calculates the total bill for the customer by multiplying their usage in
minutes by 0.1. After adding the record, customerCount is incremented by
1.If maximum records is reached then it notifies the user.
viewRecords() function
int viewRecords()
{
printf("\nName\tPhone Number\tUsage(min)\tTotal "
"Bill($)\n");
for (int i = 0; i < customerCount; i++) {
printf("%s\t%s\t%.2f\t\t%.2f\n",
customers[i].name,
customers[i].phoneNumber,
customers[i].usage,
customers[i].totalBill);
}
}
The function named viewRecords() is responsible for displaying the list of
customer records. It uses a loop to iterate through each customer
record .Within the loop, it prints the name, phone number, usage in minutes,
and total bill for each customer.
int searchRecord(char phoneNumber[]) {
printf("\nName\tPhone Number\tUsage(min)\tTotal
Bill($)\n");
for (int i = 0; i < customerCount; i++) {
if (strcmp(customers[i].phoneNumber,
phoneNumber) == 0) {
printf("%s\t%s\t%.2f\t\t%.2f\n",
customers[i].name, customers[i].phoneNumber,
customers[i].usage, customers[i].totalBill);
return;
}
}
printf("\nRecord not found!\n");
}
This function searchRecord responsible for searching for a customer record
based on their phone number. It takes a char array phoneNumber as a
parameter which is used to identify the customer. It uses a loop to iterate
through each customer record. Within the loop it checks if the phone number
of the current customer matches the provided phoneNumber. If a matching
phone number is found it prints the information of the customer including
name, phone number, usage in minutes, total bill. It displays output to the
user either displaying the customer record or informing them if the record
was not found.
Source code
#include <stdio.h>
#include <string.h>
struct Customer {
char name[50];
char phoneNumber[15];
float usage;
float totalBill;
};
struct Customer
// number of customers
int addRecord()
scanf("%s", customers[customerCount].phoneNumber);
scanf("%f", &customers[customerCount].usage);
customers[customerCount].totalBill
= customers[customerCount].usage * 0.1;
customerCount++;
else {
}
}
int viewRecords()
"Bill($)\n");
printf("%s\t%s\t%.2f\t\t%.2f\n", customers[i].name,
customers[i].phoneNumber, customers[i].usage,
customers[i].totalBill);
if (strcmp(customers[i].phoneNumber, phoneNumber)
== 0) {
printf(
customers[i].name);
scanf("%f", &customers[i].usage);
customers[i].totalBill
= customers[i].usage * 0.1;
return;
}
}
if (strcmp(customers[i].phoneNumber, phoneNumber)
== 0) {
printf(
"%s\t%s\t%.2f\t\t%.2f\n", customers[i].name,
customers[i].phoneNumber,
customers[i].usage, customers[i].totalBill);
return;
if (strcmp(customers[i].phoneNumber, phoneNumber)
== 0) {
}
customerCount--;
return;
int displayMenu()
printf("6. Exit\n");
int main()
int choice;
char phoneNumber[15];
while (1) {
displayMenu();
scanf("%d", &choice);
switch (choice) {
case 1:
addRecord();
break;
case 2:
viewRecords();
break;
case 3:
printf(
scanf("%s", phoneNumber);
modifyRecord(phoneNumber);
break;
case 4:
printf(
scanf("%s", phoneNumber);
viewPayment(phoneNumber);
break;
case 5:
printf(
scanf("%s", phoneNumber);
deleteRecord(phoneNumber);
break;
case 6:
return 0;
default:
return 0;
References
rev.io
Wikipedia.com
geeksforgeeks.org
insights.encora.com
cloudblue.com
quora.com