Telephone/Mobile Billing Management System C++ with MySql

CWC
6 Min Read

The Telephone/Mobile Billing Management System C++ with MySQL program can store new Customers, and edit, delete and update them. You can see the full list of customers and bills from the MySQL database. Check if the customer is billed or not. Check whether customer and bill ID is present or not in the database. Here I am using the MySQL database.

The main purpose of this C++ application is to specify the need and importance of automated Telephone/Mobile billing system.  By using this telephone billing management system, users can calculate their telephone bills, customer messages, bill messages, list of all customers, list of all bills, add new bill to customer, edit one customer bill, edit bills, add new customer, edit customer, delete customer, edit customer details, delete bill, check bill details, search by customer ID and check bills in a simple and easy way.

Telephone/Mobile Billing Management System C++ with MySql Program Description:

The program has a database connection class call at the beginning of the program. Our main class is Telephone class and this class has some public functions likevoid show();

  • void customerMessages();
  • void billMessages();
  • void allCustomers();
  • void allBills();
  • void addBill();
  • void editBill();
  • void addCustomer();
  • void oneCustomer();
  • void editCustomer(string);
  • void deleteCustomer();
  • void deleteBill();
  • void details();
  • bool searchById(string);
  • bool checkBilled(string);

Telephone/Mobile Billing Management System C++ with MySql Program Detail:

Global variables

  • qstate represent the state of the query. If 0 is successful 1 is failed.
  • conn is the mysql connection variable.
  • row is for getting the current row of the database.
  • res is for getting all the values form the database.

Class Telephone

  • This class contains connection of the database.
  • mysql_init is the initializer of mysql_real_connect
  • mysql_real_connect connects to the database. (MySql server should open while connecting)
  • then if statement shows the successful or failed connection.

Uses of class’s functions Constructor ()

  • In here, I connected with MySql database
  • If connection failure, then error message will be shown

Function show ()

  • It print the project name
  • Print our main menu to the user
  • And ask the user to choose one

Function details()

  • This function shows Billing Details
  • SMS rate, Call rate, MMS rate

Function checkBilled()

  • In this function, we are checking if the customer is already billed or not.
  • We select the customer id from the bill table
  • Then run the query and check if row[0] == id is equal or not

Function searchById ()

  • In this function, I searched item with one specific id passed as parameter
  • First selects all items and then checking if the row[0] means our id column from database table is equal to or not. If equal then loop will break and assign true to the found variable.
  • At last it return found variable

Function allCustomers ()

  • In this function, I fetched all items from the customers table
  • And showing them in a table
  • If query failed, then it will show the error message.

Function addBill ()

  • First show all customers
  • Then ask the user to enter customer id
  • Then check the id is present on the customer table
  • Then check if the customer is not billed
  • Then ask for total call, total sms and total mms
  • Then find the total bill
  • Insert the total sms, mms, call and total bill

Function allBills()

  • In this function, I fetched all items from the bills table
  • And showing them in a table
  • If query failed, then it will show the error message.

Function editBill()

  • In this function, show all bills
  • Ask the user to enter bill id
  • Then ask the user for new call, sms and mms
  • Then update calls, sms, mms and total
  • And then run the query
  • If the query is success then prompt the successful message

Function deleteBill()

  • In this function, show all bills
  • Ask the user to enter bill id
  • Then check if id is present or not
  • Is id present then run the delete query

Function addCustomer ()

  • Ask the user to enter name, address, street, pin, phone and account
  • Insert into customer table and run the query

Function oneCustomer()

  • Show all the customers
  • Ask the user to enter customer id to show
  • Then select this customer
  • And show in a table

Function editCustomer()

  • Update specific customer with new name, address, street, pin, phone and account
  • If query is success, then success message will show

Function deleteCustomer()

  • Ask user to enter customer id
  • If customer is present in the customer table then run delete query in this table
  • If customer is successfully deleted, then prompt success message
  • If not then show an error message

Database and Table Name

  • Table: bills, customers
  • Database: cpp_telephone_management
  • Usage: XAMPP Server, MySql Headers, MySql Libs

Download source code Telephone/Mobile Billing Management System C++ with MySql

Download source code Telephone/Mobile Billing Management System C++ with MySql
password:codewithc.com

Share This Article
4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

English
Exit mobile version