Vous êtes sur la page 1sur 50

Project Report

On

COMPUTER SHOP
SYSTEM

MASTER IN COMPUTER APPLICATION (MCA)

School of Computer Science and IT, University,


.

Submitted By: Under the guidance of:-


(Project Coordinator)
1
CERTIFICATE

This is to certify that the project report titled COMPUTER SHOP

SYSTEM is being submitted by .., bearing

Enrollment No: in MCA is a record bonafide work

carried out by them. The results embodied in this report have not been

submitted to any other University for the award of any degree.

.
(Supervisor) (Coordinator)

2
ACKNOWLEDGEMENT

I would like to convey my heartful thanks to

(Computer Science) who always gave valuable suggestions & guidance

for completion of my project. He helped me to understand & remember

important details of the project. My project has been a success only

because of his guidance.

I am especially indented & I am also beholden to my friends. And

finally I thank to the members of my family for their support &

encouragement.

3
4
Table of Contents
S.No. Title Page No.
1 Abstract 5
2 List of Figures/ tables/ screens 6
3 Database Design 11
4 Symbols & Abbreviations 12
4.1 Introduction 12
4.2 Objective of Project 12
4.3 Purpose 12
4.4 Project Scope 13
5 LITERATURE SURVEY 14
5.1 Introduction 14
5.2 Working with Existing System 14
5.3 Disadvantages of Existing system 15
5.4 Proposed System 15
6 ANALYSIS 16
6.1 Introduction 16
6.2 Software Requirement Specification 16
6.2.1 User requirement 16
6.2.2 Software requirement 16
6.2.3 Hardware requirement 16
6.3 Content diagram of Project & Flowchart 17
7 DESIGN 18
7.1 Introduction 18
7.2 DFD 19
7.3 ER diagram 21
8 Coding 22
9 IMPLEMENTATION & RESULTS 45
10 TESTING & VALIDATION 47
11 CONCLUSION 48
11.1 Project Conclusion 48
11.2 Future enhancement 48
12 Bibliography 49

5
Abstract

The Computer Shop System is designed & developed for a computer shop to manage

their records of selling and purchasing of the computer parts from the dealers and sell

them to the customers. This system make the work of the computer shopkeepers easy

as it keep all the records of the computer product and also keep the records of the

product that is sold to the customers. This system first check the availability of the

computer parts and their quantity then enter the record to the record table after

deducting number of the computer parts from the quantity and then print the invoice

after adding all the discounts and VAT% and save the record for future use if needed.

It also print the reports in a tabular form as well as according to the search of a

particular computer product available at that time ,if product is less than it provide the

facility to modify the product by adding more.

It automates the Systems records, their Selling and Maintenance, Balance evaluation,

due to calculation other functions. In other words you can say it a complete computer-

shop management System. In this project we can easily maintain systems sales details.

We can see the Systems details before selling the particular items.

6
List of Figures/ tables/ screens

LOGIN FORM

MAIN PAGE

ADMINISTRATOR

7
Choice 1:
CREATE / ADD COMPUTER PARTS

CHOICE 2:
DISPLAY ALL PRODUCT AVAILABLE

Choice 3:
Search the product

Choice 4:
Modify products

8
Choice 5:
Delete the records

Choice 6:
Display all the transactions

Choice 7:
Search and display invoice number with details

9
Choice 1:
Product report generator
First show all the products

10
11
Database Design
Database Design in most important in any project. We are using the following table to
store the information.
trans
Name Data type size
Invoiceno character 10
Cust_name character 20
Dateofpurchase character 15
Total_amt float

Invoice
Name Data type size
invoice_no character 10
prod_name character 15
qty integer
amt(amount) integer

order
Name Data type size
prodid1 integer
pname1 character 50
compy1 character 50
qty1 integer
price1 float
dis1 float

product
Name Data type size
prodid integer
name character 50
company character 50
qty integer
price integer
dis integer
descp character 100

12
Symbols & Abbreviations

Introduction
Computer-shop management System is a project which assist in keeping the
Record of whatever the sales from shop (whole seller), also it keep track of remaining
balance which due after selling the product. Through this project we maintain the
discount given on particular products along with complete information related to that
product.
Computer-shop management System is software for store billing
management. Sell hardware systems components and accessories (keep track of sold
configurations, create system configuration, sell accessories and computer
components, supplying companys administration, and many more...). Computer-shop
management System is a windows based billing software designed for uses in
computer stores.

Objective
The objective of my project to provides management facility to computer-
shop. We have given many facilities for users in this project.
1) Welcome screen
2) Login screen
3) Main form
4) Add Computer System parts
5) Modify Computer System parts
6) Update Computer System parts
7) Delete Computer System parts
8) Report of computer part
9) Report of sold computer parts invoice

10) Report of a particular computer parts

Purpose
It is the project about Computer-shop management System. It automates the
Systems records, their Selling and Maintenance, Balance evaluation, due to
calculation other functions. In other words you can say it a complete computer-shop
management System.
In this project we can easily maintain systems sales details. We can see the
Systems details before selling the particular items & view for our requirement-
satisfying item detail

13
Project Scope
The scope of project Computer-shop management system is to Develop
C++ based software to support for daily sale, receipt & Balance of products and
maintain the all information of System related items.
This software will be very useful for the small Computer Shop as well as the
customer. It will perform as the required task of Automation of product by itself in a
systematic way.
It will also save lots of time, as system will perform all tasks in quick time
profiting customer and shop owner as well, so it will prove very economical in every
respect.

14
LITERATURE SURVEY
Introduction

It is to serve as a decision document. It has three questions to answer.


Since, the present system is manual all the work is done in papers and ink by
hand so it is much costly and difficult to use and to operate and it is also time
consuming.
So our automated computerized computer shop system is much feasible, in
cost, time, and efforts as compare to the previous manual system.
It is economically feasible, it will only require a single operator to operate the
system, who is responsible for entering the data into the database via a user interface
provided to him, who can also able to show all the data in tabular form so to provide
information regarding the products that is purchased or that is sell to the customer,
since it requires only a single person to operate the whole system thus reduces the cost
to operate the system.
It is technically feasible, since the whole system is designed using the
technologies like C++ and file handling which is been used. It uses the latest hardware
technologies so easy to operate.
It is Behavioral feasible, since the system is providing a attractive user
interface to the operator/end user, so he feel very easy to work onto it. Response to
operator/end user is very fast and very good. Since, as we mentioned above that it
requires much less amount of cost, it uses computer work so it is very fast to operate
and it is very easy for user to work on it.
Working with the Existing system
In present, all work is done manually by hand in bulk of files which is hard to operate
and hard to maintain the reports of the computer parts presently available and the
product sell to the customer.
1. When the parts of computer first reached to the shop.
2. The computer product counted and the receipt is submitted to the shop personnel.
3. Office staff fill the all the information and then check how much product already
available and then added the current computer parts with it.
4. After counting each and every parts of the computer the receipt is cleared

15
Disadvantages of Present System
1. Require much man power i.e. much efforts, much cost and hard to operate
and maintain.
2. Since, all the work is done in papers so it is very hard to locate a particular
student record when it is required.
Proposed System:-
1. It is automated computerized web based software system.
2. It uses latest technologies like C++.
3. It is easy to operate.
4. Attractive user interface.

16
ANALYSIS

Introduction

The existing system is referred to as manual system.

In this system each record of the purchase and sale in needed to be entered in a
record book and accounting book should be kept carefully.

This system involves a lot of paper work.


Records are maintained in registers.

Software Requirement Specification

User requirement

Technology is used to handle data so that data can be stored efficiently and
retrieved when needed.
Less time is consumed in this process.
User friendly system.
Data can be rechecked before submitting to the database. This results into
minimal mistakes.

Software requirement

Front End Tool: C++

Back End Tool: File handling

PLATFORM USED: Windows XP, Windows 2000.

Hardware requirement

1) 20 GB HDD Free Space


2) 128 MB RAM
3) P IV or above Processor
4) Monitor
5) Keyboard: Standard
6) Mouse: Optional

Content diagram of Project/FLOWCHART

START
17
LOGIN PAGE

MAIN MENU

Products report generator Administrator

Display all Search Modify Delete


products records products products

Display all Search and display


transactions Invoice no. with details

18
DESIGN
Introduction
DATA FLOW DIAGRAMS (DFDS)
The DFD was first developed by Larry Constiane as a way of expressing system in a
graphical form. A DFD, also known as Bubble Chart, has a purpose of clarifying
system requirement and identifying major transformation that will become the
programs in the system design.

DFD SYMBOLS
1. A SQUARE defines a source or destination of system data

2. An ARROW identifies data flow or data in motion. It is a pipeline through which


information flow.

3. A CIRCLE or a BUBBLE (Some people use an over bubble) represents a process


transforms in coming data flow into outgoing data flow.

4. An OPEN RECTANGLE is a data store or data at rest or a temporary rest


repository of data.

Note that a DFD describe what data flow (logical) rather than they are processed, so it
does not depend on hardware, software and data structure or file organization.

Data Flow Diagram:

19
Zero Level DFD

Req Res
Customer Computer Customer
shop
management
System
First Level DFD

Sold
computer
part Item
User/admin Customer

login

Login
Updat
e Repor
t

Add
computer
parts Search

Compter
Part Detail

Computer Part Detail


Computer Part records

20
Second Level DFD Computer part/system

Issus details
Customer Record

Customer
parts details Computer Customer Details
User part/system

Verify sold details

Computer Parts Sold history

Customer

Sold history

Search The Item

Balance history
Search
details

User
Search Customer details

Customer &
item info
Customer records
Customer

Computer parts

21
c_name c_name c_Balance c_Balance c_address c_address
c_ph.no.

ER Diagram:-
Brand_nam
e
system_nam configuration
e
Item_price

Warranty_perio
d

Computer
system_detail

Item_name Brand_name
user_nam
e
user_add
ress

Sell
User computer Computer Parts
pars DETAIL

Login-
name&pas Item_price
sword Model
user_ph.n
o. no.

Invoicen
o.

Paid
C_nam Amoun
e t Invoice
C_name no.
no.
BALANCE

Balance
Date Customer

Paid_amoun
Tot. t
amount C_address
C_balance.

C_phone

22
Coding

//***************************************************************
// HEADER FILE USED IN PROJECT
//****************************************************************
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
#include<ctype.h>
class trans
{
// int transid;
char invoiceno[10];
char cust_name[20];
char dateofpurchase[15];
float total_amt;
public:
void display_trans()
{
gotoxy(1,8);
cout<<invoiceno<<setw(25)<<cust_name<<setw(30)<<dateofpurchase;
gotoxy(1,9);
cout<<"*****************************************************************
*************";
}
void inputtrans(char invo[10],char cust_nm[20],char dofp[15],float tot)
{
strcpy(invoiceno,invo);
strcpy(cust_name,cust_nm);
strcpy(dateofpurchase,dofp);
total_amt=tot;
}
void showalltrans(int c)
{
gotoxy(1,c);
cout<<invoiceno<<setw(18)<<cust_name<<setw(25)<<dateofpurchase<<setw(18)<<"Rs.
"<<total_amt;
}
void diplaytrans()
{
gotoxy(1,7);
cout<<setw(5)<<invoiceno<<setw(35)<<cust_name<<setw(35)<<dateofpurchase;
gotoxy(1,8);

cout<<"*****************************************************************
*************";
}
float gettotal()
{ return total_amt;
}

23
char *getinvoicemain()
{ return invoiceno;
}};
class invoice
{
char invoice_no[10];
char prod_name[15];
int qty;
float amt;
public:
void inputinvoice(char invo[10],char pnm[15],int q,float at)
{
strcpy(invoice_no,invo);
strcpy(prod_name,pnm);
qty=q;
amt=at;
}
char *getinvoice()
{ return invoice_no; }
void display(int yy)
{ gotoxy(1,yy);
cout<<prod_name;
gotoxy(10,yy);
cout<<qty;
gotoxy(27,yy);
cout<<amt;
}
void displayinvo(int yy)
{
gotoxy(5,yy);
cout<<setw(5)<<prod_name<<setw(15)<<qty<<setw(15)<<amt;
}
};
struct order
{
int prodid1;
char pname1[50];
char compy1[50];
int qty1;
float price1,dis1;
}o1[50];
int orderk=0;
int checkpass();
void searchshowinvoice();
void trans_tabular();
void copyme(int k,order order1[],int q1,int c2);
void intromain();
int getproduct();
void display_all();
void prod_tabular();
void modify_record(int n);
void delete_record(int n);
void againopenandclose();
int search(int p);
void changeqty(int pr1,int q11);

24
//***************************************************************
// CLASS USED IN PROJECT
//****************************************************************
class product
{
int prodid;
char name[50];
char company[50];
int qty;
float price,dis;
char descp[100];
public:
product()
{
qty=0;
price=0;
dis=0;
}
void modifydata(int n1,char snm[15],char companynm[15],int q);
/
************************************************************************
*****
void showdatamulti()
{
gotoxy(5,7);
cout<<"==========================================================
============";
gotoxy(10,8);
cout<<"PROD NO:";
gotoxy(30,8);
cout<<prodid;
gotoxy(40,8);
cout<<"NAME OF PROD:";
gotoxy(60,8);
cout<<name;
gotoxy(10,9);
cout<<"COMPANY:";
gotoxy(30,9);
cout<<company;
gotoxy(40,9);
cout<<"PROD PRICE:";
gotoxy(60,9);
cout<<price;
gotoxy(10,10);
cout<<"QUANTITY:";
gotoxy(30,10);
cout<<qty;
gotoxy(40,10);
cout<<"DISCOUNT";
gotoxy(60,10);
cout<<dis;
gotoxy(5,11);
cout<<"==========================================================
===========";
}

25
//***********************************************************************
******
void create_prod(int rn1)
{
//**********************************************
gotoxy(5,7);
cout<<"==========================================================
============";
gotoxy(10,8);
cout<<"PROD NO:";
prodid=rn1;
gotoxy(24,8);
cout<<prodid;
gotoxy(35,8);
cout<<"NAME OF PROD:";
gotoxy(54,8);
cin>>name;
gotoxy(10,9);
cout<<"COMPANY:";
gotoxy(22,9);
cin>>company;
gotoxy(35,9);
cout<<"QUANTITY";
gotoxy(54,9);
cin>>qty;
gotoxy(10,11);
cout<<"PROD PRICE";
gotoxy(25,11);
cin>>price;
gotoxy(35,11);
cout<<"DISCOUNT";
gotoxy(45,11);
cin>>dis;
//**********add descrpition about the product
gotoxy(10,12);
cout<<"DESCRIPTION:";
gotoxy(25,12);
gets(descp);
//*****************************************
gotoxy(5,13);
cout<<"==========================================================
===========";
}
void show_prod()
{
//********************************
gotoxy(5,7);
cout<<"==========================================================
============";
gotoxy(10,8);
cout<<"PROD NO:";
gotoxy(25,8);
cout<<prodid;
gotoxy(35,8);

26
cout<<"NAME OF PROD:";
gotoxy(54,8);
cout<<name;
gotoxy(10,9);
cout<<"COMPANY:";
gotoxy(25,9);
cout<<company;
gotoxy(35,9);
cout<<"PROD PRICE:";
gotoxy(54,9);
cout<<price;
gotoxy(10,10);
cout<<"DISCOUNT:";
gotoxy(25,10);
cout<<dis<<"%";
gotoxy(35,10);
cout<<"QUANTITY:";
gotoxy(54,10);
cout<<qty;
gotoxy(5,11);

cout<<"=========================================================
============";

//**********add descrpition about the product


gotoxy(10,12);
cout<<"DESCRIPTION:";
gotoxy(30,12);
cout<<descp;
//*****************************************
gotoxy(5,13);
cout<<"=========================================================
============";
}
//-----------------------show data tabular form----------------------
void showall(int c)
{
gotoxy(1,c);
cout<<prodid<<setw(17)<<name<<setw(11)<<company<<setw(10)<<"Rs."<<price<<set
w(15)<<qty<<setw(12)<<dis<<"%";
}
//-----------------------ends here------------------------------------
int retpno()
{return prodid;}
float retprice()
{return price;}
char* getcompany()
{ return company;}
char* getname()
{return name;}
int getqty()
{ return qty;}
float retdis()
{return dis;}
void setqty(int q21)

27
{
qty=q21;
}
}; //class ends here
//***************************************************************
// global declaration for stream object, object
//****************************************************************
//*************************modify product
void product::modifydata(int n1,char snm[15],char companynm[15],int q)
{
char tmpnm[40],tmpnm2[40];
gotoxy(5,14);
cout<<"===================WANT TO MODIFY
===============================";
gotoxy(10,15);
cout<<"PROD NO:";
prodid=n1;
gotoxy(25,15);
cout<<prodid;
gotoxy(40,15);
strcpy(name,snm);
cout<<"NAME OF PROD:";
gotoxy(60,15);
cout<<name;
gotoxy(10,17);
cout<<"Want to change the name of product";
gotoxy(50,17);
int flag=0;
while(1)
{
gets(tmpnm);
if(strlen(tmpnm)!=0)
{
flag=1;
break;
}
if(strlen(tmpnm)==0)
{ flag=0;
break;
}
}
if(flag==1)
{ strcpy(name,tmpnm);
}
gotoxy(1,18);
strcpy(company,companynm);
//****************COMPANY NAME TO BE MODIFY
cout<<"COMPANY NAME:";
gotoxy(20,18);
cout<<company;
gotoxy(35,18);
cout<<"Want to change the COMPANY";
gotoxy(65,18);
flag=0;
while(1)

28
{
gets(tmpnm2);
if(strlen(tmpnm2)!=0)
{
flag=1;
break;
}
if(strlen(tmpnm2)==0)
{ flag=0;
break;
}
}
if(flag==1)
{ strcpy(company,tmpnm2);
}
//*****************COMPANY NAME TO BE MODIFIED ENDS HERE
gotoxy(5,19);
cout<<"********MODIFY**PRODUCT PRICE - QUANTITY - DISCOUNT
***********";
//****************************************************
gotoxy(5,20);
cout<<"PRICE:";
gotoxy(15,20);
float tmppr=0;
flag=-1;
while(1)
{
cin>>tmppr;
if(tmppr!=0)
{
flag=1;
break;
}else
{ flag=0;
break;
}
}
if(flag==1)
{ price=tmppr;
}
//****************************************************
//****************************************************
gotoxy(22,20);
cout<<"INCREASE QUANTITY:";
gotoxy(45,20);
int tmpqty=0;
cin>>tmpqty;
qty=q;
qty=qty+tmpqty;
//***************************************************
//***************************************************
gotoxy(50,20);
cout<<"DISCOUNT:";
gotoxy(63,20);
float tmpdis=0;

29
cin>>tmpdis;
dis=tmpdis;
//*****************************************
gotoxy(5,22);
cout<<"==========================================================
===========";
}
//**************************class function outside
fstream fp;
product pr;
//***************************************************************
// function to write in file
//****************************************************************
void write_book()
{
fp.open("product.dat",ios::out|ios::app);
clrscr();
intromain();
int rnn=getproduct();
if(rnn>100)
{
rnn=1;
}
pr.create_prod(rnn);
fp.write((char*)&pr,sizeof(product));
fp.close();
gotoxy(10,20);
cout<<"***************PRODUCTS RECORD SAVED******************* ";
cin.ignore();
getch();
}
//********************check the product number already given or not******
int getproduct()
{
ifstream objiff;
product st;
int count=0;
objiff.open("product.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{
cout<<"File could not be open !! Press any Key...";
getch();
}
//**************temporary hiding these lines
while(objiff.read((char *) &st, sizeof(product)))
{
count++;
}
//***********jump to the last line
objiff.seekg(count-sizeof(st),ios::beg);
objiff.read((char *) &st, sizeof(product));
count=st.retpno();
count++;
objiff.close();

30
return count;
}
//***************************************************************
// function to read specific record from file
//****************************************************************
void display_sp(int n)
{
int flag=0;
fp.open("product.dat",ios::in);
if(!fp)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(fp.read((char*)&pr,sizeof(product)))
{
if(pr.retpno()==n)
{
clrscr();
intromain();
pr.show_prod();
flag=1;
}
}
fp.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}
//***************************************************************
// function to place order and generating bill for PRODUCT PURCHASED
//****************************************************************
void place_order()
{
invoice inv_obj;
ofstream objinvoice("invoice.dat",ios::binary|ios::app);
char invoiceno1[10];
char cust_name1[20];
char dateofpurchase1[15];
order o1[50];
int c=0,pr1=0;
float amt=0,damt=0,total=0,ttaxt=0;
int k=0,q1;
char ch='Y';
clrscr();
prod_tabular();
clrscr();
intromain();
gotoxy(30,4);
cout<<"============================";
gotoxy(30,5);
cout<<" PLACE YOUR ORDER";
gotoxy(30,6);
cout<<"============================";

31
//****************invoice no**********************
clrscr();
gotoxy(5,10);
cout<<"ENTER THE INVOICE NO: ";
gotoxy(55,10);
cin>>invoiceno1;
//**************************************************
//****************customer name**********************
clrscr();
gotoxy(5,10);
cout<<"ENTER THE CUSTOMER NAME: ";
gotoxy(55,10);
cin>>cust_name1;
//**************************************************
//****************DATE OF PURCHASE**********************
clrscr();
gotoxy(5,10);
cout<<"ENTER THE DATE(dd-mm-yyyy): ";
gotoxy(55,10);
cin>>dateofpurchase1;
//**************************************************
while(ch=='y' || ch=='Y')
{
clrscr();
gotoxy(5,10);
pr1=0;
cout<<"ENTER THE PRODUCT NO: ";
gotoxy(55,10);
cin>>pr1;
k=search(pr1);
if(k>0)
{
gotoxy(5,12);
cout<<"Enter the Quantity:";
gotoxy(28,12);
cin>>q1;
changeqty(pr1,q1);
copyme(k,o1,q1,c);
}else
{
cout<<"PRODUCT not found";
}
clrscr();
c++;
gotoxy(10,20);
cout<<"Do you want purchase more (Yes[ y or Y ] or NO [n or N])";
gotoxy(10,21);
cin>>ch;
if(ch=='n' || ch=='N')
break;
else
continue;
}
//***************while ends by these lines

32
clrscr();
gotoxy(20,20);
cout<<"Thank You For Placing The Order..........";
getch();
clrscr();
/**********************************************************************
display cutomer name invoice number and date of purchase by cutomer
********************************************************************* */
intromain();
gotoxy(13,5);
cout<<"INVOICE NO:"<<setw(10)<<invoiceno1<<setw(15);
cout<<"CUST.NAME:"<<setw(10)<<cust_name1<<setw(5);
gotoxy(13,6);
cout<<"DATE:"<<setw(12)<<dateofpurchase1;
gotoxy(13,7);
cout<<"*************************INVOICE************************";
gotoxy(1,8);
cout<<"PR.No."<<setw(12)<<"NAME"<<setw(10)<<"Qty"<<setw(15)<<"Price"<<setw(
13)<<"Amount"<<setw(23)<<"Amount- discount";
gotoxy(3,9);
cout<<"----------------------------------------------------------------------------";
int yy=10,xx1=1;
for(int x=0;x<c;x++)
{
gotoxy(1,yy);
cout<<xx1;
gotoxy(10,yy);
cout<<o1[x].pname1;
gotoxy(27,yy);
cout<<o1[x].qty1;
gotoxy(40,yy);
cout<<"Rs."<<o1[x].price1;
gotoxy(50,yy);
amt=o1[x].qty1*o1[x].price1;
cout<<"Rs."<<amt;
damt=(float)amt-o1[x].dis1;
gotoxy(65,yy);
cout<<"Rs."<<damt;
total+=damt;
xx1++;
yy++;
//**************copy record in a invoice file****************
inv_obj.inputinvoice(invoiceno1,o1[x].pname1,o1[x].qty1,damt);
objinvoice.write((char*)&inv_obj,sizeof(inv_obj));
//************************************************************
}
ttaxt=5;
gotoxy(3,yy);
cout<<"----------------------------------------------------------------------------";
yy++;
gotoxy(25,yy);
cout<<"TOTAL:";
gotoxy(35,yy);
cout<<total;
yy++;

33
gotoxy(25,yy);
cout<<"TAX%:";
gotoxy(36,yy);
cout<<"+"<<ttaxt;
yy++;
gotoxy(25,yy);
cout<<"----------------------------";
yy++;
gotoxy(25,yy);
cout<<"NET TOTAL:";
gotoxy(35,yy);
total=total+(0.5*total);
cout<<total;
yy++;
gotoxy(3,yy);
cout<<"----------------------------------------------------------------------------";
//************details goes to transcation table

//**********************************
trans transobj;
ofstream objtrans("trans.dat",ios::binary|ios::app);
transobj.inputtrans(invoiceno1,cust_name1,dateofpurchase1,total);
objtrans.write((char*)&transobj,sizeof(transobj));
objtrans.close();
objinvoice.close();
//*************************************************
//*****************change at the above
getch();
}
//********************fuction to copy all record to a structure

void copyme(int k2,order order1[50],int q1,int c2)


{
ifstream objiff2("product.dat",ios::binary);
product bk1;
objiff2.seekg(k2-sizeof(product));
objiff2.read((char*)&bk1,sizeof(product));
strcpy(order1[c2].pname1,bk1.getname());
strcpy(order1[c2].compy1,bk1.getcompany());
order1[c2].dis1=bk1.retdis();
order1[c2].price1=bk1.retprice();
//*********************copy record***********************
order1[c2].qty1=q1;
//c2++;
objiff2.close();
}
//***************************************************************
// INTRODUCTION FUNCTION
//****************************************************************
void intro()
{ clrscr();
gotoxy(4,2);
cout<<"****************************COMPUTER-
SHOP******************************";
gotoxy(12,4);

34
cout<<"==========================================================
=";
gotoxy(5,5);
cout<<"****************************S=Y=S=T=E=M************************
********";
gotoxy(50,10);
cout<<"PROJECT:";
gotoxy(50,12);
cout<<"MADE BY : VIKRAM MAHENDRA";
gotoxy(10,14);
cout<<"---------------MASTER IN COMPUTER APPLICATION--------------------";
getch();
}
//***************************************************************
// ADMINSTRATOR MENU FUNCTION
//****************************************************************
void admin_menu()
{
clrscr();
char ch2;
int num;
//************************************************************
clrscr();
intromain();
gotoxy(20,6);
cout<<"=================ADMIN MENU====================";
gotoxy(22,7);
cout<<"1.CREATE//ADD COMPUTER PARTS";
gotoxy(22,8);
cout<<"2.DISPLAY ALL PRODUCTS AVAILABEL";
gotoxy(22,9);
cout<<"3.SEARCH RECORD(QUERY) ";
gotoxy(22,10);
cout<<"4.MODIFY PRODUCTS";
gotoxy(22,11);
cout<<"5.DELETE PRODUCTS";
gotoxy(22,12);
cout<<"6.DISPLAY ALL TRANSCATIONS";
gotoxy(22,13);
cout<<"7.SEARCH AND DISPLAY INVOICE NO WITH DETAILS";
gotoxy(22,14);
cout<<"8.BACK TO MAIN MENU";
gotoxy(18,15);
cout<<"Please Enter Your Choice (1-8) ";
gotoxy(55,16);
//**********************************************************
ch2=getche();
switch(ch2)
{
case '1': clrscr();
write_book();
break;
case '2': prod_tabular();//display_all();
break;

35
case '3':
//********************
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE PROD ID TO BE SEARCHED:";
gotoxy(55,9);
cin>>num;
display_sp(num);
break;
case '4':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE PROD ID TO BE SEARCHED AND MODIFY:";
gotoxy(55,9);
cin>>num;
modify_record(num);
break;
case '5':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE PROD ID TO BE SEARCHED AND TO DELETE:";
gotoxy(55,9);
cin>>num;
delete_record(num);
break;
case '6': trans_tabular();
break;
case '7': searchshowinvoice();
break;
case '8': break;
default:cout<<"\a";admin_menu();
}
}
//***************************************************************
// THE MAIN FUNCTION OF PROGRAM
//****************************************************************
void main()
{
char ch;
intro();
if(checkpass()==0)
{
do
{
//****************TEMPORARY***********************
clrscr();
intromain();
gotoxy(20,6);
cout<<"=================MAIN MENU====================";
gotoxy(28,7);
cout<<"01. PRODUCTS REPORT GENERATOR";
gotoxy(28,8);

36
cout<<"02. ADMINISTRATOR";
gotoxy(28,9);
cout<<"03. EXIT";
gotoxy(20,10);
cout<<"==============================================";
gotoxy(25,12);
cout<<"Please Select Your Option (1-3) ";
gotoxy(30,14);
ch=getche();
switch(ch)
{
case '1': clrscr();
orderk=0;
place_order();
getch();
break;
case '2': admin_menu();
break;
case '3':exit(0);
default :cout<<"\a";
}
}while(ch!='3');
}else
{
exit(0);
}
}

//***************main intro
void intromain()
{ clrscr();
gotoxy(1,2);

cout<<"*************************COMPUTER****SHOP******PROJECT******
******************";
gotoxy(1,3);

cout<<"*****************************************************************
*************";
}
//***********************************************************************
*******
// DISPLAY ALL THE PRODUCT TABULAR FORM
//***********************************************************************
*******
void prod_tabular()
{
int r=0,col=10;
product st;
ifstream inFile;
inFile.open("product.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";

37
getch();
return;
}
display_all();
while(inFile.read((char *) &st, sizeof(product)))
{
if(r<=12)
{
r++;
st.showall(col);
col++;
}else
{
gotoxy(20,30);
cout<<"--------------press any key------------------------";
getch();
clrscr();
display_all();
col=10;
r=0;
}
}
inFile.close();
getch();
}
//**************************tabular forms ends *****************************
//*******************tabulars forms headings ********************************
//function to display all the records of product
//**********************************************************************
void display_all()
{
clrscr();
intromain();
gotoxy(1,5);
cout<<" **********************PRODUCTS
DETAILS***************************";
gotoxy(1,6);
cout<<"==========================================================
======================";
gotoxy(1,7);
cout<<"PROD.NO"<<setw(10)<<"NAME"<<setw(15)<<"COMPANY"<<setw(15)<<"P
RICE"<<setw(15)<<"QUANTITY"<<setw(10)<<"DISCOUNT";
gotoxy(1,8);
cout<<"==========================================================
======================";
}
//************************************************************
// MODIFY RECORD
//**********************************************************
void modify_record(int n)
{
product st,temp;
char tmpnm[50],tmpcompany[50];
ifstream inFile;
int fpos=-1;

38
inFile.open("product.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &st, sizeof(product)))
{
if(st.retpno()==n)
{ clrscr();
intromain();
st.showdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
cout<<"\n\nrecord not exist";
else
{
//*******modifying the records starts here
fstream File;
File.open("product.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &st, sizeof(product)))
{
if(st.retpno()==n)
{ fpos=(int)File.tellg();
break;
}
}
File.seekp(fpos-sizeof(product),ios::beg);
strcpy(tmpnm,st.getname());
strcpy(tmpcompany,st.getcompany());
int q1=st.getqty();
gotoxy(1,12);

cout<<"*****************************************************************
************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS
GIVEN ABOVE=================";
temp.modifydata(n,tmpnm,tmpcompany,q1);
File.write((char *) &temp, sizeof(product));
File.close();
}
}
//***********************************************************************

39
// DELETE THE RECORD OF THE PRODUCTC NOT AVAILABLE
//***********************************************************************
void delete_record(int n)
{
product st;
ifstream inFile;
inFile.open("product.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &st, sizeof(product)))
{
if(st.retpno()==n)
{ clrscr();
intromain();
st.showdatamulti();
flag=1;
}
}
inFile.close();
char ch;
if(flag==0)
cout<<"\n\nrecord not exist";
else
{
//*******deletion of the records starts from here
gotoxy(1,15);
cout<<"*************************************************************";
gotoxy(5,16);
cout<<"==DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y)
OR NO (N)========";
gotoxy(2,17);
cin>>ch;
if (toupper(ch)=='Y')
{
ofstream outFile;
outFile.open("Temp1.dat",ios::binary);
ifstream objiff("product.dat",ios::binary);
objiff.seekg(0,ios::beg);
while(objiff.read((char *) &st, sizeof(product)))
{
if(st.retpno()!=n)
{
outFile.write((char *) &st, sizeof(product));
}
}

outFile.close();
objiff.close();
remove("product.dat");
rename("Temp2.dat","product.dat");

40
againopenandclose();
gotoxy(30,20);
cout<<"----------------------------Record Deleted----------------------------------";
}
}
getch();
}
//***********************delete record
ends************************************
void againopenandclose()
{
ifstream inFile;
product st;
inFile.open("product.dat",ios::binary);
if(!inFile)
{
getch();
return;
}
while(inFile.read((char *) &st, sizeof(product)))
{
}
inFile.close();
}
//***********************search the product***********************
int search(int p)
{
product st;
int tmprt=0;
ifstream inFile;
inFile.open("product.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return -1;
}
int flag=0;
while(inFile.read((char *) &st, sizeof(product)))
{
if(st.retpno()==p)
{ clrscr();
intromain();
st.showdatamulti();
flag=1;
tmprt=(int)inFile.tellg();
break;
}
}
inFile.close();
if(flag==0)
return 0;
//cout<<"\n\nrecord not exist";
else
{

41
return tmprt;
}
}
//********************change quantity*************************
void changeqty(int pr1,int q11)
{
product st;
int fpos=-1;
fstream File;
File.open("product.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &st, sizeof(product)))
{
if(st.retpno()==pr1)
{ fpos=(int)File.tellg();
break;
}
}
File.seekp(fpos-sizeof(product),ios::beg);
int q1=st.getqty();
q1=q1-q11;
st.setqty(q1);
File.write((char *) &st, sizeof(product));
File.close();
}
//****************************TRANSCATIONS
DETAILS***************************
void display_alltrans()
{
clrscr();
intromain();
gotoxy(1,5);
cout<<" **********************TRANSCATION
DETAILS***************************";
gotoxy(1,6);
cout<<"==========================================================
======================";
gotoxy(1,7);
cout<<"INVOICENO"<<setw(18)<<"CUSTNAME"<<setw(20)<<"DATE"<<setw(20)<
<"TOTALAMT";
gotoxy(1,8);
cout<<"==========================================================
======================";
}
//**********************************************************************
// DISPLAY INVOICE NO AND ALL PRODUCT DETAILS
//**********************************************************************
void searchshowinvoice()
{
char invno[10];

42
trans trans1;
invoice invoobj;
int transflag=-1,yy1=10;
float endtot=0.00f;
ifstream objifftrans("trans.dat",ios::binary);
ifstream objinvoice("invoice.dat",ios::binary);
clrscr();
intromain();
//************display the invoices details first
gotoxy(5,5);
cout<<"ENTER THE INVOICE NO:";
gotoxy(30,5);
cin>>invno;

if(!objifftrans)
{
cout<<"File could not be open !! Press any Key...";
getch();

}else
{
gotoxy(1,5);
cout<<"********************INVOICE
DETAILS****************************";
gotoxy(1,6);
cout<<setw(5)<<"INVOICE NO"<<setw(25)<<"CUSTOMER
NAME"<<setw(25)<<"DATE";
gotoxy(1,7);

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

while(objifftrans.read((char *) &trans1, sizeof(trans1)))


{
if(strcmp(trans1.getinvoicemain(),invno)==0)
{
transflag=1;
trans1.display_trans();
endtot=trans1.gettotal();
break;
}
}
objifftrans.close();
getch();
if(transflag==1)
{
if(!objinvoice)
{
cout<<"File could not be open !! Press any Key...";
getch();
}else
{
gotoxy(5,11);
cout<<"*****************DETAILS OF PRODUCTS********************";
gotoxy(5,13);
cout<<"***********************************************************";

43
gotoxy(5,15);

cout<<setw(5)<<"PROD_NAME"<<setw(15)<<"QUANT."<<setw(15)<<"AMOUNT";
gotoxy(5,17);
cout<<"***********************************************************";
yy1=20;
while(objinvoice.read((char *) &invoobj, sizeof(invoobj)))
{
if(strcmp(invno,invoobj.getinvoice())==0)
{
invoobj.displayinvo(yy1);
yy1++;
}
}
transflag=-1;
objinvoice.close();
yy1++;
gotoxy(5,yy1);
cout<<"***********************************************************";
yy1++;
gotoxy(10,yy1);
cout<<"NET TOTAL: "<<endtot;
getch();
}

}
}

//*****************************ENDS************************************
//**********************************************************************
// DISPLAY ALL THE TRANSCATIONS TABULAR FORM
//**********************************************************************
void trans_tabular()
{
int r=0,col=10;
trans trans1;
ifstream inFile;
inFile.open("trans.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";

getch();
return;
}
display_alltrans();
while(inFile.read((char *) &trans1, sizeof(trans1)))
{
if(r<=12)
{
r++;
trans1.showalltrans(col);

44
col++;
}else
{
gotoxy(20,30);
cout<<"--------------press any key------------------------";
getch();
clrscr();
display_alltrans();
col=10;
r=0;
}
}
inFile.close();
getch();
}
//**************************tabular forms ends******************************

//******************************login name and password****************


int checkpass()
{
char nm[20];
char pass[10];
clrscr();
intromain();
gotoxy(20,20);
cout<<"PLEASE ENTER THE USER NAME:";
gotoxy(20,21);
cin>>nm;
clrscr();
gotoxy(20,20);
cout<<"PLEASE ENTER THE PASSWORD:";
gotoxy(20,21);
cin>>pass;
if(strcmp(nm,"admin")==0 && strcmp(pass,"vicky")==0)
{
return 0;
}else
{
return 1;
}
}
//********************************************************************

//***************************************************************
// END OF PROJECT
//***************************************************************

45
IMPLEMENTATION & RESULTS
Explanation of Key functions

1. Login
In this, existing user/administrator enters the user-name and password and
access the main form. This contains user name and password as module.

2. Main Form
If administrator accesses this form using authentic login-name and password
then the administrator has administrative power as add the product, create user
account, add new branded computer system, add company, change the shop record .
Administrator have full power But user have some restricted power only which is
provided by administrator.
In this user can sell computer part/assemble computer system/branded
computer system, update customer record. Using this the user/administrator can see
the report of sold computer part, branded computer system in any time duration. In
this there is option to exit.

3. Sell Computer System


In sell assembled computer system/computer part module,
user/administrator can sell available computer part and assembled computer system.
In this ,the user/administrator enters the customer name, address & phone number and
chooses all computer part to sell according to request of customer. The user /
administrator can chose any product, its type, range, its serial number using combo-
box. After choosing the serial number of product the price of the product and total
price (including vat, tax) automatically generate. After selling, the user/administrator
can print and save the receipt. The invoice number and customer number
automatically generate by this software when this form is loaded.

4. Update Customer Balance


In this, there is information related to balance of customer, customer name
and address. In future if any customer paid the balance amount then it can be update.

5. Add Product
In this, the administrator can add new product by entering its name,
company name, range, type, serial number, and its price. Here administrator can also
see the available product and its information. And the administrator can also delete
any product.
6. Product Price Report:
This report shows the price of all available products and its detail as item-
name, company-name, type, range, and serial-number.

7. Sold computer part Report:


This report show the sold computer part in any time duration. The
administrator/user can see the detail of sold computer part in specified time duration.
This report show the name of customer, item-name, company-name, type, range,

46
serial-number, and price of sold product.

8. Sold computer system Report:


This report shows the sold computer system in any time duration. The
administrator/user can see the detail of sold computer system in specified time
duration. This report shows the name of customer, category, company-name, model-
number, ram capacity and its speed, monitor type, Hard-disk capacity and its
interface, processor clock speed and its L2cach, motherboard company-name and its
chipset, its price and other description.

47
TESTING & VALIDATION

Software testing is a criterion of software quality assurance and represents the


ultimate review of specified designing and coding.

System testing reveals the presence of errors in the software developed.

Testing is the process of executing a program with the intent of finding an error.

A good test is one that has a high probability for finding a yet undiscovered error.

A successful test is one that uncovers the hidden errors.

Characteristics of Testing:

Testing begins at the module level and works outward and towards the integration of
the entire computer based system.

Different testing techniques are appropriate at different level of time.

48
CONCLUSION
Project Conclusion

Nothing is perfect in this world. So, we are also no exception. Although, we have tried
our best to present the information effectively, yet, there can be further enhancement
in the Application. We have taken care of all the critical aspects, which need to take
care of during the development of the Project. Like the things this project also has
some limitations and can further be enhances by someone, because there are certain
drawbacks that do not permit the system to be 100% accurate.

Future enhancement

The project has covered almost all the requirements. Further requirements and
improvements can easily be done since the coding is mainly structured or modular in
nature. Improvements can be appended by changing the existing modules.
We think that not a single project is ever considered as complete forever because our
mind is always thinking new and our necessities also are growing.

Our application Also, if you see at the first glance that you find it to be
complete but we want to make it still mature and fully automatic.

As system is flexible you can generate more report and screen as and when required.

The system is modified in future as per the owner requirement.

In this system we can add more reports about users so more and more Information
about computer parts.

49
Bibliography

The C++ Programming Language , 3rd Edition / Stroustrup Addison-Wesley.

C++ Primer, 3rd Edition / Lippman and Lajoie Addison-Wesley.


The Scott Meyers series, Addison-Wesley:

Effective C++ : 50 Specific Ways to Improve Your Programs and Designs, 2nd
Edition

More Effective C++ : 35 New Ways to Improve Your Programs and Designs
and Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template
Library

Beginners' C++ Course, 3rd Edition Ron Wein

50

Vous aimerez peut-être aussi