You are on page 1of 36

Government Polytechnic Nandurbar Academic year :2023- 24

Sub : Object-oriented programming using c++ Semester : Third

Project Name : Simple Billing System

A study on

Simple Billing System


Submitted in December 2021 by a group of…..5…..students

Roll No. Name Enrollment No.


2131 Yogita Sharad Deore 2214320040
2104 Sayali Nandu Shinde 2214320003
2130 Priyanshu Kishor Chaudhari 2214320039
2127 Minal Dharmendra Pande 2214320036
2135 Kalyani DipaK Sathe 2214320045

Under the Guidance of

Mr. Magan Vasave


in

Three Years Diploma Program in Engineering & Technology of

Maharashtra State Board of Technical Education, Mumbai (Autonomous)

at

1432 GOVERNMENT POLYTECHNIC NANDURBAR.

1
Maharashtra State Board Of Technical
Education, Mumbai
Certificate
This is to certify that Mr. /Ms. 1) Yogita Sharad Deore.(Roll No: 2131)
2) Sayali Nandu Shinde.(Roll No: 2104)
3) Priyanshu Kishor Chaudhari.(Roll No: 2130)
4) Minal Dharmendra Pande.(Roll No:2127)
5) Kalyani Dipak Sathe.(Roll No:2135)

Of Third Semester of Computer Engineering, Diploma in Engineering & Technology at


1432 GOVERNMENT POLYTECHNIC NANDURBAR, has completed the MicroProject
satisfactorily in Subject OOP in the academic year 2023-2024 as per the
MSBTE prescribed curriculum of I Scheme. Place: Nandurbar, Enrollment No:
1) 2214320040
2) 2214320003
3) 2214320039
4) 2214320036
5)2214320045

Project Guide Head of the Department Principal


2
~~ INDEX ~~

Sr. No. Title Page No.


1 Abstract 4
2 Introduction 4
3 Aim of the Micro-Project 4
4 Problem definition 5
Future scope of the Micro-
5 5
Project
6 Features 5
7 Resources Required 6
8 About the System 7
9 Characteristics 8
10 Coding Details 9 to 12
11 Algorithm 13
12 Source code 14 to 25
13 Actual procedure followed 25
Testing and execution of
14 26 to 31
the Micro-Project
15 Conclusion 32
16 Project Outcomes Integrated 32
Skill Developed/Learning
17 Outcomes of this Micro- 32
Project
18 References 33

3
Abstract

In this Micro project, we are demonstrating a simple billing system in c++ programming language.
Simple Billing System is a project that can manage our billing information and the inventory items.
The system will manage some specific details such as Item no, Price, Item Name, Date Manufacture.
The purpose of the system is to effectively manage and maintain the billings of each item.

Introduction

C++ is a general-purpose programming language designed by Bjarne Stroustrup as an


extension to the C language, with object-oriented data abstraction mechanisms and strong
static type safety. Compliance with the C language at the source code level remains one of
the primary design goals of subsequent language standards.
Bjarne Stroustrup initially called the new language "C with Classes." However, in 1983 the
name was changed to C++.
Since 1998, the ISO / IEC 14882:1998 standard (Standard for the C + + Programming
Language) with minor amendments approved in 2003 (ISO / IEC 14882:2003) have remained
applicable. In 2009, a new standard was announced (known as C++0x), which came into
effect as of August 2011.
It is a highly developed programming language in terms of operators, simplicity, and ease of
notation. This allows for data abstraction and the use of several programming paradigms:
procedural, object-oriented and generic. It is characterized by the high performance of the
object code, direct access to hardware resources and system functions, ease of creation and
use of libraries (written in C++, C, or other languages), independence of any specific
hardware or system platform (which ensures high portability of source codes) and a small
execution environment. It is mainly used in applications and operating systems.
The C++ language can be used for building higher-level applications with graphics libraries,
applications to communicate with network devices and computer network simulators as
well as remote device systems and network management.

Aim of the Micro Project

 Use the C ++ programming language to create simple useful programs.


 Build a program for simple billing system using c++ programming language
 Apply basic OOP features in program

4
Problem definition

We have made this Micro project to overcome following problems:

 Difficulties to manage huge amount of data effectively for efficient results


 Lot of paperwork
 Difficulties in reports generating
 Inability of modification of data
 Time consuming for calculations
 Unsecured data storing

Future Scope of the Micro-Project

The future scope of the Micro-Project is as follows:

 This program can be useful in apps of billing.


 This program is useful in shops and shopping malls.
 This program can be used for keeping and maintaining expenditure records.
 This program can be easily implemented in any billing system.

Features

 It is easy to use.
 It is very reliable and accurate.
 It is a user friendly system.

5
Resources Required

For the completion of this Micro-Project, we have mainly required the following resources:

Name of the
Serial Number Resource/Material Specifications Quantity Remarks

HP
Laptop(AMD
Hardware/Computer Ryzen 5
(i) 1
System 5600H with
Radeon
Graphics),
Ram = 8GB ,
SSD 528GB
Windows
11 home
(ii) Operating system 1

Turbo C ++
Version - 3.0
(iii) Software 1

6
About the System

The Simple Billing System was created in a simple console application, the system is
openly-accessed you don't need to enter any login information. The user has many
job to do in the system in the system, you can add new Item detail, update current
Item detail, remove item detail, etc. With the use of this system it will greatly help
you for your business transaction. It can fasten your working process by automating
the data input for your inventory. The system will store your data input as a text file
extension. The Simple Billing System was created in a basic C++ programming
principle in order to make any apps simpler and productive.

7
Characteristics

The Characteristics of the proposed system are as follows :

Add item detail

Characteristics of
Edit item simple Billing Delete item detail
detail System

Search item record

8
Coding Details

■ Header files used

#include<iostream>

iostream is the header file which contains all the functions of program like cout, cin etc. its a
header file in c++ which is responsible for input/output stream.

#include<windows.h>
windows.h is a Windows-specific header file for the C and C++ programming languages which
contains declarations for all of the functions in the Windows API, all the common macros used by
Windows programmers, and all the data types used by the various functions and subsystems. It
defines a very large number of Windows specific functions that can be used in C.

#include<conio.h>

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output.
conio stands for "console input and output".

#include<fstream>

It is used to create files, write information to files, and read information from files. The
fstream term stands for File Stream.

9
#include<cstring>
This header file defines several functions to manipulate C strings and arrays. Cstring is a
header file required for string functions.

#include<cstdio>
The C++ <cstdio> header file includes several macros and functions of C-style input/output
library. This library uses what are called streams to operate with physical devices such as
keyboards, printers, terminals or with any other type of files supported by the system.

#include<cstdlib>
The C++ Standard Library header file (cstdlib in C++) is the header for one of the most
widely used libraries by programmers of the language. This header defines a collection of
functions and macros to facilitate efficient, high-performing, standardized C++ code across
teams and platforms.

#include<iomanip>
The iomanip is a library in C++ which helps us in manipulating the output of any C++
program. There are many functions in this library that help in manipulating the output. To
name a few we have functions to reset flags, set fill characters, set precision, get date and
time, etc.

10
■ Switch case

The switch case statement is widely used for building most of the big projects, which can
be used as actual applications. We have used switch case here to perform different
conditions as per our choice. Switch case statement evaluates a given expression
and based on the evaluated value(matching a certain condition), it executes the
statements associated with it. Basically, it is used to perform different actions
based on different conditions(cases).

 Switch case statements follow a selection-control mechanism and allow a


value to change control of execution.
 They are a substitute for long if statements that compare a variable
to several integral values.
 The switch statement is a multiway branch statement. It provides an easy
way to dispatch execution to different parts of code based on the value
of the expression.

■ Classes and Objects

Class: A class in C++ is the building block that leads to Object-Oriented programming. It is a
user-defined data type, which holds its own data members and member functions, which
can be accessed and used by creating an instance of that class. A C++ class is like a
blueprint for an object.

 A Class is a user defined data-type which has data members and member functions.
 Data members are the data variables and member functions are the functions
used to manipulate these variables and together these data members and
member functions defines the properties and behavior of the objects in a Class.

An Object is an instance of a Class. When a class is defined, no memory is allocated


but when it is instantiated (i.e. an object is created) memory is allocated.

Declaring Objects: When a class is defined, only the specification for the object is defined;
no memory or storage is allocated. To use the data and access functions defined in the
class, you need to create objects.

11
■ Defined member functions

Member functions are operators and functions that are declared as members of a class. Member
functions do not include operators and functions declared with the friend specifier. These are
called friends of a class. You can declare a member function as static; this is called a static member
function. A member function that is not declared as static is called a nonstatic member function.

The definition of a member function is within the scope of its enclosing class. The body of a
member function is analysed after the class declaration so that members of that class can be used
in the member function body, even if the member function definition appears before the
declaration of that member in the class member list. You can use trailing return types for member
functions, including those that have complicated return types.

■ Accessing data members and member functions


The data members and member functions of class can be accessed using the dot(‘.’) operator with
the object. For example if the name of object is obj and you want to access the member function
with the name printName() then you will have to write obj.printName() .

The public data members are also accessed in the same way given however the private data
members are not allowed to be accessed directly by the object. Accessing a data member depends
solely on the access control of that data member.
This access control is given by Access modifiers in C++. There are three access modifiers : public,
private and protected.

12
Algorithm

Step 1 : start
Step 2 : Display the menu

Step 3 : switch for the values of choice.


Case choice = Bill report
Break;
Case choice = Add/Remove/Edit item
Break;
Case choice = Show item details
Break;
Case choice = Exit
Step 4 : End of the program

13
Source code

#include<iostream>

#include<windows.h>

#include<conio.h>

#include<fstream>

#include<cstring>

#include<cstdio>

#include<cstdlib>

#include<iomanip>

using namespace std;

int k=7,r=0,flag=0;

COORD coord = {0,

0};

void gotoxy(int x, int y)

COORD coord;

coord.X = x;

coord.Y = y;

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);

struct date

int mm,dd,yy;

};

ofstream fout;

ifstream fin;

class item

int itemno;

char name[25];

date d;

14
public:

void add()

cout<<"\n\n\tItem No: ";

cin>>itemno;

cout<<"\n\n\tName of the item: ";

cin>>name;

//gets(name);

cout<<"\n\n\tManufacturing Date(dd-mm-yy): ";

cin>>d.mm>>d.dd>>d.yy;

void show()

cout<<"\n\tItem No: ";

cout<<itemno; cout<<"\n\n\

tName of the item: ";

cout<<name;

cout<<"\n\n\tDate : ";

cout<<d.mm<<"-"<<d.dd<<"-"<<d.yy

void report()

gotoxy(3,k);

cout<<itemno;

gotoxy(13,k);

puts(name);

int retno()

return(itemno);

};

class amount: public item

float price,qty,tax,gross,dis,netamt;

15
public:

void add();

void show();

void report();

void calculate();

void pay();

float retnetamt()

return(netamt);

} amt;

void amount::add()

item::add(); cout<<"\n\n\

tPrice: "; cin>>price;

cout<<"\n\n\tQuantity: ";

cin>>qty;

cout<<"\n\n\tTax percent: ";

cin>>tax;

cout<<"\n\n\tDiscount percent: ";

cin>>dis;

calculate();

fout.write((char *)&amt,sizeof(amt));

fout.close();

void amount::calculate()

gross=price+(price*(tax/100));

netamt=qty*(gross-(gross*(dis/100)))

void amount::show()

fin.open("itemstore.dat",ios::binary);

fin.read((char*)&amt,sizeof(amt));

item::show();

cout<<"\n\n\tNet amount: ";

16
cout<<netamt;

fin.close();

void amount::report()

item::report();

gotoxy(23,k);

cout<<price;

gotoxy(33,k);

cout<<qty;

gotoxy(44,k);

cout<<tax;

gotoxy(52,k);

cout<<dis;

gotoxy(64,k);

cout<<netamt;

k=k+1;

if(k==50)

gotoxy(25,50);

cout<<"PRESS ANY KEY TO CONTINUE...";

getch();

k=7;

system("cls");

gotoxy(30,3);

cout<<" ITEM DETAILS ";

gotoxy(3,5);

cout<<"NUMBER";

gotoxy(13,5);

cout<<"NAME";

gotoxy(23,5);

cout<<"PRICE";

gotoxy(33,5);

cout<<"QUANTITY";

gotoxy(44,5);

cout<<"TAX"

gotoxy(52,5);

17
cout<<"DEDUCTION";

gotoxy(64,5);

cout<<"NET AMOUNT";

void amount::pay()

show(); cout<<"\n\n\n\t\

t*********************************************"; cout<<"\n\t\t

DETAILS "; cout<<"\n\t\

t*********************************************"; cout<<"\n\n\t\

tPRICE :"<<price;

cout<<"\n\n\t\tQUANTITY :"<<qty;

cout<<"\n\t\tTAX PERCENTAGE :"<<tax;

cout<<"\n\t\tDISCOUNT PERCENTAGE :"<<dis;

cout<<"\n\n\n\t\tNET AMOUNT :

$"<<netamt;

cout<<"\n\t\t*********************************************";

int main()

cout.setf(ios::fixed);

cout.setf(ios::showpoint);

cout<<setprecision(2);

fstream tmp("temp.dat",ios::binary|ios::out);

menu:

system("cls");

gotoxy(27,2);

cout<<"SIMPLE BILLING SYSTEM";

gotoxy(25,3);

cout<<"=========================\n\n";

cout<<"\n\t\t1.Bill Report\n\n"; cout<<"\t\

t2.Add/Remove/Edit Item\n\n"; cout<<"\t\

t3.Show Item Details\n\n"; cout<<"\t\t4.Exit\n\

n";

cout<<"\t\tPlease Enter Required Option: ";

int ch,ff;

18
float gtotal;

cin>>ch;

switch(ch)

case 1:

ss:

system("cls");

gotoxy(25,2);

cout<<"Bill Details";

gotoxy(25,3);

cout<<"================\n\n";

cout<<"\n\t\t1.All Items\n\n"; cout<<"\t\

t2.Back to Main menu\n\n"; cout<<"\t\

tPlease Enter Required Option: "; int cho;

cin>>cho;

if(cho==1)

system("cls");

gotoxy(30,3);

cout<<" BILL DETAILS ";

gotoxy(3,5);

cout<<"ITEM NO";

gotoxy(13,5);

cout<<"NAME";

gotoxy(23,5);

cout<<"PRICE";

gotoxy(33,5);

cout<<"QUANTITY";

gotoxy(44,5);

cout<<"TAX %";

gotoxy(52,5);

cout<<"DISCOUNT %";

gotoxy(64,5);

cout<<"NET AMOUNT";

fin.open("itemstore.dat",ios::binary); if(!

fin)

19
cout<<"\n\nFile Not Found...";

goto menu;

fin.seekg(0);

gtotal=0;

while(!fin.eof())

fin.read((char*)&amt,sizeof(amt));

if(!fin.eof())

amt.report();

gtotal+=amt.retnetamt();

ff=0;

if(ff!=0) gtotal=0;

gotoxy(17,k);

cout<<"\n\n\n\t\t\tGrand Total="<<gtotal;

getch();

fin.close();

if(cho==2)

goto menu;

goto ss;

case 2:

db:

system("cls");

gotoxy(25,2);

cout<<"Bill Manager";

gotoxy(25,3);

cout<<"=================\n\n";

cout<<"\n\t\t1.Add Item Details\n\n";

cout<<"\t\t2.Edit Item Details\n\n";

cout<<"\t\t3.Delete Item Details\n\n";

cout<<"\t\t4.Back to Main Menu ";

int apc;

20
cin>>apc;

switch(apc)

case 1:

fout.open("itemstore.dat",ios::binary|ios::app);

amt.add();

cout<<"\n\t\tItem Added Successfully!";

getch();

goto db;

case 2:

int ino;

flag=0;

cout<<"\n\n\tEnter Item Number to be Edited :";

cin>>ino;

fin.open("itemstore.dat",ios::binary);

fout.open("itemstore.dat",ios::binary|ios::app);

if(!fin)

cout<<"\n\nFile Not Found...";

goto menu;

fin.seekg(0);

r=0;

while(!fin.eof())

fin.read((char*)&amt,sizeof(amt));

if(!fin.eof())

int x=amt.item::retno();

if(x==ino)

flag=1;

fout.seekp(r*sizeof(amt));

system("cls");

cout<<"\n\t\tCurrent Details are\n";

amt.show();

cout<<"\n\n\t\tEnter New Details\n";

21
amt.add();

cout<<"\n\t\tItem Details editted";

} r+

+;

if(flag==0)

cout<<"\n\t\tItem No does not exist...Please Retry!";

getch();

goto db;

fin.close();

getch();

goto db;

case 3:

flag=0;

cout<<"\n\n\tEnter Item Number to be deleted :";

cin>>ino;

fin.open("itemstore.dat",ios::binary); if(!

fin)

cout<<"\n\nFile Not Found...";

goto menu;

fin.seekg(0);

while(fin.read((char*)&amt, sizeof(amt)))

int x=amt.item::retno();

if(x!=ino)

tmp.write((char*)&amt,sizeof(amt));

else

flag=1;

22
fin.close();

tmp.close();

fout.open("itemstore.dat",ios::trunc|ios::binary);

fout.seekp(0); tmp.open("temp.dat",ios::binary|

ios::in); if(!tmp)

cout<<"Error in File";

goto db;

while(tmp.read((char*)&amt,sizeof(amt)))

fout.write((char*)&amt,sizeof(amt));

tmp.close();

fout.close();

if(flag==1)

cout<<"\n\t\tItem Succesfully Deleted";

else if (flag==0)

cout<<"\n\t\tItem does not Exist! Please Retry";

getch();

goto db;

case 4:

goto menu;

default:

cout<<"\n\n\t\tWrong Choice!!! Retry";

getch();

goto db;

case 3:

system("cls");

flag=0;

int ino;

cout<<"\n\n\t\tEnter Item Number :";

cin>>ino;

fin.open("itemstore.dat",ios::binary);

if(!fin)

cout<<"\n\nFile Not Found...\nProgram Terminated!";

goto menu;

23
}

fin.seekg(0);

while(fin.read((char*)&amt,sizeof(amt)))

int x=amt.item::retno();

if(x==ino)

amt.pay();

flag=1;

break;

if(flag==0)

cout<<"\n\t\tItem does not exist ...Please Retry!";

getch();

fin.close();

goto menu;

case 4:

system("cls");

gotoxy(20,20);

cout<<"ARE YOU SURE, YOU WANT TO EXIT (Y/N)?";

char yn;

cin>>yn;

if((yn=='Y')||(yn=='y'))

gotoxy(12,20);

system("cls");

cout<<"************************** THANKS **************************************";

getch();

exit(0);

else if((yn=='N')||(yn=='n'))

goto menu;

else

goto menu;

default:

24
cout<<"\n\n\t\tWrong Choice....Please Retry!";

getch();

goto menu;

return 0;

Actual procedure followed

1. First of all, Survey about the project was done.

2. Collected the information about the Micro-Project from Internet and textbooks
of curriculum.

3. Practically testing of the Micro-Project i.e. ,Written and executed the finalized program.

4. Gathered and analyzed all this information. After that, finally created the report of this
Micro-Project.

25
Testing and execution of the program

When we execute the prepared coding on output-screen, the following output is shown.

26
27
28
29
30
31
Conclusion

We have studied and executed the program of C ++ i.e. Simple Billing System successfully.
From this, we have understood various concepts of object oriented programming. We had
tried our best to include basic features of OOP in our project. We aimed it to be an
interfacing application to the real world that means our project must not be an project for
any examination but also applicable for real world use. We have able to give some benefits
to the disability. From this project we were able to achieve various knowledge in Object
Orientated Programming. We refresh our knowledge in C++ Programming. Moreover, we
also gained an experience of group work, team coordination.

Project Outcomes Integrated

a) Create and utilize Simple Billing System program.


b) Learn various OOP features by applying it into the program.

Skill Developed / learning out of this Micro-Project

+ Discipline knowledge: Apply Computer engineering discipline- specific


knowledge to solve core computer engineering related problem.
+ Experiments and practice: Plan to perform experiments and practices to use the

results to solve broad-based Computer engineering problems.


+ Engineering tools: Apply relevant Computer technologies and tools with an
understanding of the limitations.
+ Communication: Communication effectively in oral and written form.

32
References

https://www.programmingsimplified.com
https://www.javatpoint.com
https://developerinsider.com
https://www.tutorialspoint.com

33
Weekly Work / Progress Report
Details of 16 Engagement Hours of the Student

Regarding Completion of the Micro-Project

Sr. no. Date Timing Work or activity Sign of the


performed guide
--- --- From To Time --- ---
in
hours
1 18/09/2023 2.00 3.00 1 Discussion and
finalization of
the project title
2 24/09/2023 2.00 3.00 1 Preparation and
submission of
abstract
3 28/09/2023 4.00 5.00 1 Literature
review
4 01/10/2023 4.00 5.00 1 Collection of
data
5 07/10/2023 2.00 3.00 1 Sorting of data

6 15/10/2023 3.00 4.00 1 Discussion and


outline of
contents
7 21/10/2023 2.00 3.00 1 Rough writing of
contents
8 29/10/2022 4.00 5.00 1 Editing and
proof reading of
contents
9 03/11/202 4.00 5.00 1 Final completion
of the project
10 05/11/2021 2.00 3.00 1 Presentation,
assessment and
submission of
the report

34
ANNEXURE-II
Evaluation Sheet for the Micro Project (Teachers Copy)

Academic year: 2023-24 Name of faculty: Mr. Magan Vasave

Semester: 3rd Program Name: Computer Engineering

Course Name: OOP Course code: 22316


Name of students:
1) Yogita Sharad Deore
2) Sayali Nandu Shinde
3) Priyanshiu Kishor Chaudhari
4) Minal Dharmendra Pande
5) Kalyani Dipak Sathe
Title of the project: Simple Billing System

COs addressed by the Micro Project:

(A) Major Learning Outcomes achieved by students by doing

the Project:

(a) Practical Outcomes:

1. Basic knowledge

2. Discipline knowledge

3. Experiments and Practice

(b) Outcomes (in Cognitive domain)

1. Processing information

2. Constructing

3. Understanding

4. Applying knowledge

( c) Outcomes in Affective Domain

1. Follow safety measures.

2. Follow ethical practices

35
□ Comment/Suggestions about team work/leadership/inter-personal

Communication (If Any):

Roll No. Name of Marks Marks out of 4 Total marks out


students out of 6 for performance of 10
for in
perform oral/presentation
ance in
group
activity
2131 Yogita Sharad Deore

2104 Sayali Nandu Shinde

2130 Priyanshu Kishor


Chaudhari
2127 Minal Dharmendra
Pande
2135 Kalyani Dipak Sathe

( )

Signature with Name and Designation of the Faculty Member

36

You might also like