SlideShare a Scribd company logo
This is to certify that
Neil Mathew, Roll No: _____ ,
has successfully completed his Project
under my guidance and has fulfilled
the requirements for the submission of this project.
Ms. Geetu Munjal,
_________________
CERTIFICATE
CONTENTS
S No: Name: Page No:
1 ACKNOWLEDGEMENT 1 [ 1 - 1 ]
2 INTRODUCTION 2 [ 1-2 ]
3 THE 6 FACES OF THE CUBE 3 [ 1–2 ]
4 FLOW CHART DIAGRAM 4 [ 1-4 ]
5 USER DEFINED FUNCTIONS 5 [ 1-1 ]
6 PROGRAM CODE 6 [ 1-17 ]
7 SAMPLE INPUT & OUTPUT 7 [ 1-33 ]
8 BIBLIOGRAPHY 8 [ 1-1 ]
9 SCOPE FOR FUTURE EXPANSION 9 [ 1-1 ]
1: [1]
ACKNOWLEDGEMENT
I am indebted to my computer teacher,
Ms Geetu Munjal
for her guidance and whole hearted support
in the making of this project.
2:[1]
I call this software ‘THE CUBE’.
This is mainly because of the fact that it performs 6 types of tasks.
Three of them are general while the other three are user specific.
The Cube is made for 3 types of users:
A Customer, A Supplier and The Manager.
A more elaborate coverage of The Cube’s function can be seen in
‘THE 6 FACES OF THE CUBE”.
INTRODUCTION
This software is made to cover the processes associated with an Antique Store.
Its applications extend to customers, suppliers, cashiers, managers
and other staff members alike.
Besides allowing us to view and search the items on sale, its main priority is
maintaining a record of the transaction of money and items.
With a buy, an item is lost and its price is added to the store balance.
Similarly, If the manager was to accept a Supplier’s offer,
that items asked price would be subtracted from the store balance
and be added to the list of items on sale.
This allows the Store to have a constantly updated reference to check
the progress of the store.
2: [2]
INTRODUCTION
To make it implementable in the real world, I have ensured that:
(1) Data is stored in files and opened in binary mode for speed.
(2) The interface has been made interactive and user friendly.
(3) It has covered all possible threats to efficacy by means of
Intensive Exception Handling like:
(i) Invalid Entries by User
(ii) An Advanced Search that is NOT case sensitive.
(iii) And many others like:
Maintaining transfer of cash through sale and purchase of the store,
Maintaining Transfer of Data from Supplier Offer to Item On Sale, etc
3: [1]
THE LIST
This is a Tabular representation of the list of items on sale in the
store. The following 4 entities are displayed here.
 The Item number
 The Name
 The Age (in Years)
 The Cost
SPACING TOOL
There is a function
which is responsible
for the tabular
format of THE LIST.
1
THE HISTORY
2
This is a more detailed view of the items in THE LIST.
It not only gives the 4 entities in THE LIST but also shows the
history of the item and its significance in the past.
However, only a limited number of items can be seen at a time.
THE SEARCH
3 This allows users to search for an item, making it much easier
than going through the long list to find something specific.
The search allows us to narrow down the list by
 Providing Ranges in the Cost and Age
 A word search for Name and History.
THE 6 FACES OF THE CUBE
This is a more elaborate explanation of THE CUBE
and the various tasks that it performs.
3: [2]
I AM A CUSTOMER
Once the money transfer is complete:
 A bill for the user will be displayed.
 There will be an increase in the store balance.
 The item will be removed from THE LIST.
4
I AM A SUPPLIER
5 The user will have to enter the details of the item
he wishes to sell including the price he is asking for
it. This will be stored and decided later by the manager.
I AM THE MANAGER
6
This option is for the manager. Since this is restricted to the
general public, it is password protected.
The Manager has the most number of options. He can add,
delete and edit an item on THE LIST. He can change the
password and access the CUBE CASHIER.
THE 6 FACES OF THE CUBE
This is one of the 3 user specific options.
If this is chosen, the user will be able to choose and buy the item
of his choice.
CUBE CASHIER
This is a money organizer
for the store. When an
item is sold or bought by
the store, the balance
increases and decreases
accordingly.
This option is for those who have something
to sell to the store.
When the manager accepts:
 The item will be added to the LIST.
 There will be a decrease in the store balance.
FLOW CHART DIAGRAM
START
DISPLAY THE VARIOUS OPTIONS:
(1) THE LIST | (2) THE HISTORY | (3) THE SEARCH |
| (4) I AM A CUSTOMER | (5) I AM A SUPPLIER | (6) I AM THE MANAGER
CHOOSE
(Input Ch)
RESTART
THE DO WHILE LOOP
421 3 5 6
IF
CH=1
|| CH=2 || CH=3
|| CH=4 || CH=5
|| CH=6 ||
CH=0
Ch=1 Ch=2 Ch=3 Ch=4 Ch=5 Ch=6 ELSE
END
Ch=0
SHOW
ERROR
MESSAGE
0
1 void view()
SHOWS THE LIST OF ITEMS
void Space()
PROVIDES TABULAR FORMAT
FOR THE LIST
void SORT_LIST()
SORTS THE LIST ACCORDING
TO ASCENDING ITEMNO
2
void viewHis()
SHOWS THE LIST OF ITEMS
WITH HISTORY OF EACH
Call Call
Call Call
3
DISPLAYS THE VARIOUS OPTIONS
| PROVIDE RANGES IN
(1) AGE (2) COST
| A WORD SEARCH FOR
(3) NAME OF ITEM (4) HISTORY
CHOOSE
(Input Ch)
IF
CH=1
|| CH=2
|| CH=3
|| CH=4
ELSE
Ch=1 Ch=2 Ch=3
SHOW
ERROR
MESSAGE
Ch=4
0
0
0
ASKS FOR
UPPER LIMIT &
LOWER LIMIT
THEN DISPLAYS
THE SEARCH
RESULTS
ASKS FOR
THE WORD TO
SEARCH FOR
THEN DISPLAYS
THE SEARCH
RESULTS
ASKS FOR
UPPER LIMIT &
LOWER LIMIT
THEN DISPLAYS
THE SEARCH
RESULTS
ASKS FOR
THE WORD TO
SEARCH FOR
THEN DISPLAYS
THE SEARCH
RESULTS
FLOW CHART DIAGRAM
5
SHOW
ASKS HOW MANY ITEMS THE
SUPPLIER IS WILLIING TO SELL.
ENTER
(Input num)
SHOW:
ASKS FOR ITEM NO: TO BUY:
4
ENTER ITEMNO
(INPUT CHK)
TRUE
IF
CHK
COINCIDES WITH
EXISTING
ITEM NO
FALSE
SHOW:
ASKS WHETHER TO BUY MORE? (y/n)
ENTER
(INPUT OK)
TRUE
IF
OK = ‘Y’
||
OK= ‘y’
FALSE
SHOW:
THE BILL OF ALL
ITEMS PURCHASED
0
SHOW:
SHOW WHICH ALL
DETAILS OF ITEM IS
REQUIRED:
IF
num LOOPS
ARE COMPLETED.
ENTER THE DETAILS
FALSE
FLOW CHART DIAGRAM
FLOW CHART DIAGRAM
6
DISPLAYS THE VARIOUS OPTIONS
| (1) CHANGE YOUR PASSWORD.
| (2) ADD AN ITEM TO THE LIST.
| (3) DELETE AN ITEM ON THE LIST.
| (4) EDIT AN ITEM ON THE LIST.
| (5) USE THE CUBE CASHIIER
| (0) EXIT
SHOW
“ENTER PASSWORD” SHOW
“WRONG PASSWORD”
IF
PW == PASS
ENTER
(Input PW)
FALSE
TRUECHOOSE
(Input Ch)
IF
CH=1
|| CH=2 || CH=3
|| CH=4 || CH=5
|| CH=0
ELSE
0
Ch=0
CHANGES THE
STRING STORED IN
PASS OF CLASS
MANAGER WHICH
IS LATER STORED
INTO A DATAFILE.
Ch=1
void ADD()
ALLOWS MANAGER TO ADD
RECORDS/ITEMS FROM
(1) SUPPLIER
(HIS ITEMS’S DETAILS ARE
SHOWN AND USER CAN
ACCEPT OR DECLINE THE
SUPPLIER’S OFFER )
(2) FROM MANAGER
( HE CAN ADD THE ITEMS
HIMSELF TO THE STORE )
void EDIT()
ACCORDING TO THE ITEM NO
INPUTTED, DETAILS CAN BE CHANGED
void DEL()
ACCORDING TO THE ITEM NO INPUTTED,
ITEM & ITS DETAILS ARE DELETED.void CCASH()
ALLOWS USER TO
VIEW, DEPOSIT AND
WITHDRAW FROM HIS
STORES’ BALANCE
0
Ch=4
Ch=3
Ch=5
Ch=2
5: [1]
.
OTHERS10
I AM THE MANAGER16
I AM A SUPPLIER15
I AM A CUSTOMER14
THE SEARCH
13
THE HISTORY12
THE LIST1 VOID VIEW() - DISPLAYS THE ITEMS IN TABULAR FORMAT
VOID VIEWHIS() - SHOWS THE HISTORY OF THE ITEM
VOID SEARCH() - FINDS AN ITEM BY SEARCHING
FOR KEYWORDS IN NAME, AND RANGE IN AGE AND COST
VOID BUY() - ALLOWS USER TO BUY ITEMS ON THE LIST
 VOID PW() – CHANGES PASSWORD TO ENTER THIS
 VOID CCASH() – CUBE CASHIER ALLOWING USER TO
DEPOSIT, WITHDRAW AND VIEW STORE’S BALANCE
 VOID EDIT() – EDITS INFO OF EXISTING ITEM IN LIST
 VOID ADD() – ADDS AN ITEM TO LIST (INDIRECTLY
FROM SUPPLIER OR DIRECTLY FROM MANAGER)
 VOID DEL() – DELETES AN EXISTING ITEM FROM LIST
VOID SELL() - ALLOWS USER TO SELL ITEMS TO STORE
 VOID SPACE() – RESPONSIBLE FOR PROPER SPACING OF
STRINGS AND INTEGERS (FUNCTION OVERLOADING)
 INT FIND_IT() – FINDS THE POSITION OF THE ITEM IN
THE ARRAY BY COMPARING ITEM NUMBERS AND RETURNS IT
 VOID REMOVE_IT() – REMOVES THE ITEM FROM THE
LIST. BOTH DEL() AND BUY() CALLS THIS FUNCTION
 VOID SORT_LIST() – SORTS THE ITEMS IN THE LIST
VOID ALL_IN() – WRITES ALL INFO INTO DATAFILE
VOID ALL_OUT() – READS ALL INFO INTO PROGRAM
USER DEFINED FUNCTIONS
6: [1]
PROGRAM CODE
#include<fstream.h>
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<ctype.h>
#include<dos.h>
//SPACING TOOL OVERLOADED FUNCTIONS
//For Strings:
void Space(int n,char str[40],char sp=' ')
{
/* There is a fixed number of places(n),
and after the string (str) is displayed, the
remaining places are filled with spaces OR a char (sp).
This allows the data to be shown more aligned. */
int i;
cout.write(str,strlen(str));
int L=(n-strlen(str));
for(i=1; i<=L; i++)
{
cout<<sp;
}
}
//For Unsigned Long:
void Space(int n, unsigned long a)
{
/* Same concept as above
BUT a different arrangement for Nos.
From the fixed number of places(n),
the number (a) is displayed at the end
rather than the beginning as for strings. */
unsigned long i=a;
int count=0;
do
{
i=i/10;
count++;
}
while(i>0);
for(i=1; i<=(n-count); i++)
putchar(' ');
cout<<a;
}
6: [2]
PROGRAM CODE
//For Integers.
void Space(int n, int a)
{
int i=a;
int count=0;
do
{
i=i/10;
count++;
}
while(i>0);
for(i=1; i<=((n-count)); i++)
putchar(' ');
cout<<a;
}
6: [3]
PROGRAM CODE
//GLOBAL MEMBERS
int total;
void count();
void ALL_IN();
void ALL_OUT();
//THE CLASS LIST STARTS HERE:
class LIST
{
public:
char itmNo[40];
char Name[40];
int Age;
unsigned long Cost;
char His[100];
LIST()
{ clrscr();
//Creation of datafile if program opened for first time:
fstream f;
f.open( "CB_LIST.DAT", ios::out | ios::noreplace );
f.close();
count();
ALL_IN();
}
~LIST()
{ ALL_OUT(); }
void view(); //Displays the List in tabular form
void viewHis(); //Displays List with History
void Search(); //Search an item on List.
void Buy(); //Deletes an item (Customer Option)
void Sell(); /*Saves the details of the item to sell
for consideration (Supplier Option) */
void DEL(); //Deletes an item (Manager Option)
void ADD(); //Adds an item (Manager Option)
void EDIT(); //Edits an existing item (Manager Option)
private:
void SORT_LIST(); //Sorts the items in the LIST acc to Item No.
int Find_it(char [40]); //Finds the pos of item to delete w.r.t Item No.
void Remove_it(char [40]); //Removes an item from the List
}cb[200],ob;
6: [4]
PROGRAM CODE
//GLOBAL MEMBERS
int stotal;
void scount();
void sALL_IN();
void sALL_OUT();
// THE CLASS Sup STARTS HERE:
class Sup
{
public:
char Name[40];
int Age;
unsigned long Cost;
char His[100];
Sup()
{
//Creation of datafile if program opened for first time:
fstream f;
f.open( "CB_SALE.DAT", ios::out | ios::noreplace | ios::binary);
f.close();
scount();
sALL_IN();
}
~Sup()
{ sALL_OUT(); }
}s[20],sob,sob2;
6: [5]
PROGRAM CODE
//GLOBAL MEMBERS
void PASS_IN();
void PASS_OUT();
void BAL_IN();
void BAL_OUT();
// THE CLASS MNGR STARTS HERE:
unsigned long bal; //balance
char pass[10]; //password
class Mngr
{
public:
unsigned long dw; //deposit or withdraw.
Mngr()
{
//Creation of datafile if program opened for first time:
fstream f;
f.open( "CB_PASS.DAT", ios::out | ios::noreplace );
f.close();
fstream f2;
f2.open( "CB_BAL.DAT", ios::out | ios::noreplace );
f2.close();
PASS_IN(); //Retrieves the password from a datafile
BAL_IN(); //Retrieves the current store balance from a datafile
}
~Mngr()
{
PASS_OUT(); //Sends the password into a datafile
BAL_OUT(); //Sends the current store balance into a datafile
}
void PW(); //Function that changes the password
void Cview(); //Function that shows Store Balance
void Cdep(unsigned long); //Function that allows us to deposit money
void Cwid(unsigned long); //Function that allows us to withdraw money
void CCash(); // Function that opens the menu for CUBE CASHIER
} m1;
6: [6]
PROGRAM CODE
// THE FUNCTIONS THAT WORK WITH DATA FILES.
// Function count Finds No of Items in Store
void count()
{
fstream f;
f.open( "CB_LIST.DAT", ios::in | ios::binary );
int counter=0;
while( ! f.eof() )
{
f.read((char*)&sob, sizeof(LIST));
counter++;
};
counter--; //since one record extra is always counted.
f.close();
total=counter;
}
// Reads the data from the datafile and Stores the values intohe array objects.
void ALL_IN()
{
fstream chew;
chew.open( "CB_LIST.DAT", ios::in | ios::binary );
int i=0;
while( i<total )
{
chew.read((char*)&ob, sizeof(ob));
strcpy(cb[i].itmNo, ob.itmNo);
strcpy(cb[i].Name, ob.Name);
cb[i].Age=ob.Age;
cb[i].Cost=ob.Cost;
strcpy(cb[i].His, ob.His );
i++;
};
chew.close();
}
6: [7]
PROGRAM CODE
// Writes the data from the array objects into the data file.
void ALL_OUT()
{
fstream blow;
blow.open( "CB_LIST.DAT", ios::out | ios::binary | ios::trunc );
int i=0;
while( i<total )
{
blow.write((char*)&cb[i], sizeof(LIST));
i++;
};
blow.close();
}
// Counts the no of Supplier offers for the manager to decide on later.
void scount()
{
fstream f;
f.open( "CB_SALE.DAT", ios::in | ios::binary );
int counter=0;
while( ! f.eof() )
{
f.read((char*)&sob2, sizeof(sob2));
counter++;
};
counter--; //since one record extra is always counted.
f.close();
stotal=counter;
}
6: [8]
PROGRAM CODE
// Reads the data from the data file and Stores the values into the array objects.
void sALL_IN()
{
fstream chew;
chew.open( "CB_SALE.DAT", ios::in | ios::binary );
int i=0;
while( i < stotal )
{
chew.read((char*)&sob, sizeof(sob));
strcpy(s[i].Name, sob.Name);
s[i].Age=sob.Age;
s[i].Cost=sob.Cost;
strcpy(s[i].His, sob.His );
i++;
};
chew.close();
}
// Writes the data from the array objects into the data file.
void sALL_OUT()
{
fstream blow;
blow.open( "CB_SALE.DAT", ios::out | ios::binary | ios::trunc );
int i=0;
while( i< stotal )
{
blow.write((char*)&s[i], sizeof(LIST));
i++;
};
blow.close();
}
6: [9]
PROGRAM CODE
// Retrieves the store balance from the Data File.
void BAL_IN()
{
fstream chew;
chew.open( "CB_BAL.DAT", ios::in);
chew>>bal;
chew.close();
}
// Stores the Store Balance into the Data File.
void BAL_OUT()
{
fstream blow;
blow.open( "CB_BAL.DAT", ios::out | ios::binary | ios::trunc );
blow<<bal;
blow.close();
}
// Retrieves the Password from the Data File.
void PASS_IN()
{
fstream chew;
chew.open( "CB_PASS.DAT", ios::in);
chew>>pass;
chew.close();
}
// Stores the Password into the Data File.
void PASS_OUT()
{
fstream blow;
blow.open( "CB_PASS.DAT", ios::out | ios::binary | ios::trunc );
blow<<pass;
blow.close();
}
6: [10]
PROGRAM CODE
// THE CLASS MNGR FUNCTIONS:
void Mngr ::PW()
{
char Upass[10]; //user pass
cout<<"n Please enter the new Password (10 char)n ";
gets(Upass);
cout<<"n Your Password has been Changed from”;
cout<<“ " "<<pass<<" " to " "<<Upass<<" " .n";
strcpy(pass,Upass);
}
void Mngr ::Cview()
{
cout<<"n The Balance in your Account: "<<bal;
cout<<endl;
}
void Mngr ::Cdep(unsigned long dep=-1)
{
if(dep==-1) //by manager
{
cout<<"n How much money to deposit into Account?n ";
cin>>dw; cin.ignore();
bal+=dw;
Cview();
}
else
{ bal+=dep; }
}
void Mngr ::Cwid(unsigned long wid=-1)
{
if(wid==-1) //by manager
{
cout<<"n How much money to withdraw into Account?n ";
cin>>dw; cin.ignore();
if( dw>bal )
{ cout<<"n There is not enough money to withdraw."; }
else
{bal-=dw; }
Cview();
}
else
{ bal-=wid; }
}
6: [11]
PROGRAM CODE
void Mngr::CCash()
{
int ch; char ok;
cout<<"n Welcome to The Cube Cashier.";
do
{
cout<<"n Choose Among The Options Below: nn 1. View Balancenn 2.
Depositnn 3. Withdraw n ";
cout<<"n Your Choice (1-3) :"; cin>>ch;
cin.ignore(); cout<<endl;
switch(ch)
{
case 1: Cview(); break;
case 2: Cdep(); break;
case 3: Cwid(); break;
default: cout<<"n Invalid Option.";
}
cout<<"n Exit Cube Cashier? (Y/N) :";
cin.get(ok);
cout<<endl;
}while(ok=='n' || ok=='N');
}
6: [12]
PROGRAM CODE
// THE CLASS LIST FUNCTIONS:
void LIST::view()
{
SORT_LIST();
Space(33,"_",'_'); Space(41,"THE LIST",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|nn";
for(int j=0; j<total; j++)
{
Space(12,cb[j].itmNo);
Space(42,cb[j].Name);
Space(7,cb[j].Age);
Space(12,cb[j].Cost);
cout<<"nn";
if((j+1)%10==0 && j!=0 && total>10)
{ cout<<" See the next 10 items? (Y/N) : ";
char ch; cin.get(ch); cout<<endl;
if(ch=='y' || ch=='Y')
continue;
else
break;
}
} //End of for loop.
//Exception Handling
if(total==0)
{
Space(22,"");
Space(52,"<<<< NO ITEMS FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
cout<<endl; getch(); cout<<endl;
}
6: [13]
PROGRAM CODE
void LIST::viewHis()
{
char temp[100];
SORT_LIST();
Space(31,"_",'_'); Space(43,"THE HISTORY",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|nn";
for(int i=0; i<total; i++)
{
Space(12,cb[i].itmNo);
Space(42,cb[i].Name);
Space(7,cb[i].Age);
Space(12,cb[i].Cost);
cout<<"nn";
Space(12," | HISTORY: ");
Space(57, cb[i].His ); cout<<endl;
if( (i+1)!=total )
Space(74,"",'_');
cout<<"nn";
if( (i+1)%5==0 && i!=0 && total>5)
{ cout<<" See the next 5 items? (Y/N) : ";
char ch; cin.get(ch); cout<<endl;
if(ch=='y' || ch=='Y')
{
clrscr();
Space(31,"_",'_'); Space(43,"THE HISTORY",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|nn";
continue;
}
else
break;
} //end of outer if loop
} //end of for loop
6: [14]
PROGRAM CODE
//Exception Handling
if(total==0)
{
Space(22,"");
Space(52,"<<<< NO ITEMS FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
cout<<endl; getch(); cout<<endl;
}
void LIST::SORT_LIST()
{
char tempIN[40];
char tempName[40];
int tempAge;
unsigned long tempCost;
char tempHis[100];
int i;
int flag=0;
for(i=total; i>0; i--)
{
for(int j=0; j<i-1; j++)
{
//To Compare the Strings.
for(int o=0; o<strlen(cb[j].itmNo); o++)
{
if(cb[j].itmNo[o]==cb[j+1].itmNo[o])
continue;
else if(cb[j].itmNo[o]>cb[j+1].itmNo[o])
{ flag=1; break; }
else
{flag=0; break;}
} //inner most for loop.
if(flag==1)
{
strcpy(tempIN,cb[j].itmNo);
strcpy(cb[j].itmNo,cb[j+1].itmNo);
strcpy(cb[j+1].itmNo,tempIN);
strcpy(tempName,cb[j].Name);
strcpy(cb[j].Name,cb[j+1].Name);
strcpy(cb[j+1].Name,tempName);
6: [15]
PROGRAM CODE
tempAge=cb[j].Age;
cb[j].Age=cb[j+1].Age;
cb[j+1].Age=tempAge;
tempCost=cb[j].Cost;
cb[j].Cost=cb[j+1].Cost;
cb[j+1].Cost=tempCost;
strcpy(tempHis,cb[j].His);
strcpy(cb[j].His,cb[j+1].His);
strcpy(cb[j+1].His,tempHis);
} //END OF COMPARING STRING (IF STATEMENT)
} //END OF INNER FOR LOOP
} //END OF OUTER FOR LOOP
}
void LIST::Search()
{
int i;
char S[40];
char Su[40];
char Sl[40];
Space(33,"_",'_'); Space(41,"THE SEARCH",'_'); cout<<endl;
cout<<"n Which entity to search in?";
cout<<"nn 1. Namenn 2. Agenn 3. Costnn 4. Historynn Your Choice
(1-4) : ";
int ch; cin>>ch;
switch(ch)
{
case 1:
cout<<"n Enter a Word to Search for: ";
gets(S);
//to remove the case sensitivity of a search.
for(i=0; i<strlen(S); i++)
{
Su[i]=toupper(S[i]);
Sl[i]=tolower(S[i]);
}
cout<<"n";
Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|";
6: [16]
PROGRAM CODE
cout<<"nn";
int count=0; //counts no of letters in each word
int J=0; //a memory location for temporary positions.
int flag=0;
// Outer loop searches moves from item to item nof LIST
for(i=0; i<total; i++)
{
//Making Last character of every String/Name an End of Word character
// i.e <space>
if( cb[i].Name[ (strlen(cb[i].Name)-1) ] !=' ' )
cb[i].Name[ (strlen(cb[i].Name)) ]=' ';
// Inner loop compares word by word of an item NAME at a time
for(int j=0; j< strlen( cb[i].Name ) ; j++)
{
J=j-1;
if(cb[i].Name[j]==' ')
continue;
do //Finds total length of the word.
{
J++;
count++;
}
while(cb[i].Name[J+1] != ' ');
//outermost if
if(count==strlen(S))
{ //if the lengths of searched item and word are same.
if( (cb[i].Name[j]==Su[0]) || (cb[i].Name[j]==Sl[0]) )
{ // if the first character of both searched item and name is same
// Innermost loop compares character by character from
// the starting of each word in the Item Name.
for(int o=0; o<count; o++)
{
if(cb[i].Name[j+o]==Su[o] || cb[i].Name[j+o]==Sl[o])
{ // if the character of the searched word and word in the Item Name is same
if(o==count-1) // if this is the last character
{
flag=1;
Space(12,cb[i].itmNo);
Space(42,cb[i].Name);
Space(7,cb[i].Age);
Space(12,cb[i].Cost);
cout<<"nn";
}//end of innermost if
6: [17]
PROGRAM CODE
} // end of if statement that checks first character of both words
else
{break; } //end of 3rd inner if-else
}//end of innermost for loop
}//end of inner if loop
}//outermost if
//moves the counter ( j )of the loop that searches word by word to the next
//word of item Name.
j+=(count-1);
count=0;
} //inner for loop.
} //outer loop.
//Exception Handling
if(flag==0)
{
Space(22,"");
Space(52,"<<<< NO SUCH ITEM FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
6: [18]
PROGRAM CODE
case 4:
//The Search in the History of an item is the same
//as the Search in the Name of the item
cout<<"n Enter a Word to Search for: ";
gets(S);
//to remove the case sensitivity of a search.
for(i=0; i<strlen(S); i++)
{
Su[i]=toupper(S[i]);
Sl[i]=tolower(S[i]);
}
cout<<"n";
Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|";
cout<<"nn";
count=0; //counts no of letters in each word
J=0; //a memory location for temporary positions.
flag=0;
for(i=0; i<total; i++)
{
if( cb[i].His[ (strlen(cb[i].His)-1) ] !=' ' )
cb[i].His[ (strlen(cb[i].His)) ]=' ';
for(int j=0; j< strlen( cb[i].His ) ; j++)
{
J=j-1;
if(cb[i].His[j]==' ')
continue;
//Finds total length of the word.
do
{
J++;
count++;
}
while(cb[i].His[J+1] != ' ');
//outermost if
if(count==strlen(S))
{ //if the lengths of searched item and word is same.
if( (cb[i].His[j]==Su[0]) || (cb[i].His[j]==Sl[0]) )
6: [19]
PROGRAM CODE
{
for(int o=0; o<count; o++)
{
if(cb[i].His[j+o]==Su[o] || cb[i].His[j+o]==Sl[o])
{
if(o==count-1)
{
flag=1;
Space(12,cb[i].itmNo);
Space(42,cb[i].Name);
Space(7,cb[i].Age);
Space(12,cb[i].Cost);
cout<<"n";
Space(12," | ");
Space(10, "History: "); cout<<"n";
Space(12," | ");
Space(70, cb[i].His); cout<<"... ";
cout<<"nnn";
} //end of 4th inner if
}
else
{ break; }
}//end of innermost for loop
}//end of if loop
} //outermost if
j+=(count-1);
count=0;
} //inner for loop.
} //outer loop.
if(flag==0)
{
Space(22,"");
Space(52,"<<<< NO SUCH ITEM FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
6: [20]
PROGRAM CODE
case 2: //Search in Age of Item
unsigned long U,L; //upper limit, lower limit
flag=0;
cout<<"n Enter the Upper Limit and Lower Limit. (Both Included in
Search.)n";
cout<<"n ttt Lower Limit: "; cin>>L;
cout<<" ttt Upper Limit: "; cin>>U;
cout<<"nn ttt [ "<<L<<" <--> "<<U<<" ]";
cout<<endl;
cout<<"n";
Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|";
cout<<"nn";
for(i=0; i<total; i++)
{
if( cb[i].Age >=L && cb[i].Age <=U )
{
flag=1;
Space(12,cb[i].itmNo);
Space(42,cb[i].Name);
Space(7,cb[i].Age);
Space(12,cb[i].Cost);
cout<<"nn";
}
}
//EXCEPTION HANDLING:
if(flag==0)
{
Space(22,"");
Space(52,"<<<< NO SUCH ITEM FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
6: [21]
PROGRAM CODE
case 3: //Search in Cost
// It is the same as the search in age,
//except for the fact that Cost is an unsigned long datatype,
//and Age is an integer datatype
flag=0;
cout<<"n Enter the Upper Limit and Lower Limit. (Both Included in
Search.)n";
cout<<"n ttt Lower Limit: "; cin>>L;
cout<<" ttt Upper Limit: "; cin>>U;
cout<<"nn ttt [ "<<L<<" <--> "<<U<<" ]";
cout<<endl;
cout<<"n";
Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl;
Space(12,"Item No | ");
Space(42,"Name of Item");
Space(7,"| Age");
Space(12,"| Cost");
cout<<"|";
cout<<"nn";
for(i=0; i<total; i++)
{
if( cb[i].Cost >=L && cb[i].Cost <=U )
{
flag=1;
Space(12,cb[i].itmNo);
Space(42,cb[i].Name);
Space(7,cb[i].Age);
Space(12,cb[i].Cost);
cout<<"nn";
}
}
if(flag==0)
{
Space(22,"");
Space(52,"<<<< NO SUCH ITEM FOUND! >>>>");
cout<<endl<<endl;
}
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
default: cout<<"Invalid Choice. "<<'n';
}
//end of switch case
} // End of Search()
6: [22]
PROGRAM CODE
int LIST::Find_it(char chk[40])
{
int pos=-5;
//String Comparism
for(int i=0; i<total; i++)
{
if(chk[0]==cb[i].itmNo[0])
{
for(int j=0; j<strlen(cb[i].itmNo); j++)
{
if(chk[j]==cb[i].itmNo[j])
{
if(j==strlen(cb[i].itmNo)-1)
pos=i;
}
else
{ break; }
}
}
}
return pos;
}
void LIST::Remove_it(char chk[40])
{
int pos=Find_it(chk);
//Deleting the items at position pos:
for(int i=pos; i<total-1; i++)
{
strcpy(cb[i].itmNo,cb[i+1].itmNo);
strcpy(cb[i].Name, cb[i+1].Name);
cb[i].Age=cb[i+1].Age;
cb[i].Cost=cb[i+1].Cost;
}
total--;
}
6: [23]
PROGRAM CODE
void LIST::DEL()
{
char chk[40]; char ok='n';
do
{
cout<<" Enter the item number of the item you wish to delete.n ";
gets(chk);
int pos=Find_it(chk);
if(pos==-5) //Error Handling
{
cout<<" No such Item Number. n You may have typed it Wrong."<<'n';
cout<<"nn Try again (y/n) ?n ";
cin.get(ok);
cin.ignore(); //Buffer error removed.
cout<<"n";
}
else
{
Remove_it(chk);
cout<<"nn The Item has been deleted.nn";
ok='n';
}
}
while(ok=='y' || ok=='Y');
char ok2='n';
cout<<" Would you like to see THE LIST? (Y/N) n ";
cin.get(ok2);
if(ok2=='y' || ok2=='Y')
{ cout<<"nn"; view(); }
}
6: [24]
PROGRAM CODE
void LIST::Buy()
{
char ok='n';
int pos[5];
int count=-1;
char chk[5][40];
char bought='n';
do
{count++;
cout<<" Enter the item number of the item you wish to buyn ";
gets(chk[count]);
//Error Handling : You can not buy same item twice.
int ok3=0;
for(int i=0; i<count; i++)
{
if(strcmp(chk[count],chk[i])==0)
ok3=1;
}
if(ok3==1)
{cout<<"n You cannot buy the same item twice! nn"; count--; continue; }
//END OF ERROR HANDLING.
pos[count]=Find_it(chk[count]);
//Error Handling: Wrong Item Number Entered.
if(pos[count]==-5)
{ cout<<"n INVALID Item Number. Try Again. (y/n) n ";
count--;
ok='n';
}
//To allow users to buy more than one item. max 5.
else
{
bought='y';
cout<<"n Buy Another item? (y/n) [MAX: 5 items per Bill] n ";
}
cin.get(ok); cout<<endl;
cin.ignore(); //Buffer error
}
while(ok=='y' || ok=='Y');
if(bought=='y')
{
Space(20,"_",'_'); Space(30,"BILL",'_'); cout<<endl;
Space(40,"| Name");
6: [25]
PROGRAM CODE
Space(1 0,"| Cost");
cout<<endl;
unsigned long totalcost=0;
for(int i=0; i<=count; i++)
{
Space(40,cb[pos[i]].Name);
Space(10,cb[pos[i]].Cost);
totalcost+=cb[pos[i]].Cost;
cout<<endl;
}
Space(20,"_",'_'); Space(30,"_",'_'); cout<<endl;
Space(40," TOTAL: "); Space(10,totalcost);
cout<<"nn Thank you for shopping at This Antique Store. n";
for(i=0; i<=count; i++)
{
Remove_it(cb[pos[i]].itmNo);
}
bal+=totalcost; //increasing store balance.
}
else
{
cout<<"n Hope you find something of interest next time.";
}
}
6: [26]
PROGRAM CODE
void LIST::EDIT()
{
char chk[40];
cout<<" Enter the Item No of the Item to Editn ";
gets(chk);
int pos=Find_it(chk);
if(pos==-5)
cout<<"n Invalid Item No.";
else
{ char ok='n';
do
{
cout<<"n Which entity do you want to edit?";
cout<<"nn 1. Namenn 2. Agenn 3. Costnn 4. Historynn Your
Choice (1-4) : ";
int ch; cin>>ch;
cin.ignore();
switch(ch)
{
case 1:
cout<<"n Enter the new Name: ";
char name[40]; gets(name);
strcpy(cb[pos].Name,name);
break;
case 2:
cout<<"n Enter the new Age: ";
int age; cin>>age;
cb[pos].Age=age;
break;
case 3:
cout<<"n Enter the new Cost: ";
unsigned long cost; cin>>cost;
cb[pos].Cost=cost;
break;
case 4:
cout<<"n Enter the new History:n ";
char his[100]; gets(his);
strcpy(cb[pos].His , his);
break;
default: cout<<" INVALID CHOICE. n";
}
cin.ignore();
cout<<" nn Any more EDITs on this item? (Y/N) : ";
cin.get(ok);
}
while(ok=='y' || ok=='Y');
cout<<" n Your EDITING has been successful! ";
}
6: [27]
PROGRAM CODE
} // END OF EDIT()
void LIST::ADD()
{
cout<<"n TO ADD AN ITEM TO THE STORE.nn 1. From Suppliernn 2.
From Manager.nn ";
cout<<"Your Choice (1-2) : ";
int chk; cin>>chk;
int i;
switch(chk)
{
case 1:
if( stotal > 0 )
{
for(i=0; i<stotal; i++)
{
cout<<"n Item #"<<(i+1);
cout<<"n Name of Item : "<<s[i].Name;
cout<<"n Age of Item : "<<s[i].Age;
cout<<"n Asked Price : "<<s[i].Cost;
cout<<"n History : "<<s[i].His;
cout<<"nn ACCEPT OR DECLINE? (A/D): ";
char ch2; cin>>ch2;
cout<<endl;
if(ch2=='a' || ch2=='A')
{
for(int j=0; j<1; j++)
{
cout<<" Enter the Item No of new Item:n ";
gets(cb[total].itmNo);
//ERROR HANDLING. ITEM NO MUST BE UNIQUE.
if(Find_it(cb[total].itmNo)!=-5) //if item number as such exists
{
cout<<" Entered Item Number Already Exists. RETRY! nn";
j--;
continue;
}
//END OF ERROR HANDLING.
} //END of inner FOR LOOP
cout<<"n Enter the new Item's Price:n ";
cin>>cb[total].Cost;
m1.Cwid(s[i].Cost);
//removing asked price by supplier from the store balance.
strcpy( cb[total].Name,s[i].Name );
6: [28]
PROGRAM CODE
cb[total].Age=s[i].Age;
strcpy( cb[total].His,s[i].His );
total++;
}
else if(ch2=='d' || ch2=='D')
{
cout<<" Item is Declined.n";
}
if( (i+1) == stotal )
{
cout<<"n No More Items By Supplier.n";
//clearing the CB_SALE.dat
fstream f;
f.open("CB_SALE.DAT", ios::out | ios::trunc );
f.close();
//end of clearing
}
} //end of for loop.
//Deleting items from the Supplier Waiting List.
stotal=0;
}
else
{
cout<<"n No Items by Supplier n";
}
break;
case 2:
cout<<"n How many items to add? : ";
int noi; cin>>noi; //no of items to sell
cout<<endl;
for(i=0; i<noi; i++)
{
cout<<"n Item To Add ("<<(i+1)<<"/"<<noi<<")nn";
cout<<" Enter the Item No of new Item : "; gets(cb[total].itmNo);
//ERROR HANDLING. ITEM NO MUST BE UNIQUE.
if(Find_it(cb[total].itmNo)!=-5) //if itm number as such exists
{cout<<"n Entered Item Number Already Exists. RETRY! nn";
i--;
continue;
}
//END OF ERROR HANDLING.
cout<<"n Enter the Name of the Item : "; gets(cb[total].Name);
cout<<"n Enter the Age of the Item : "; cin>>cb[total].Age;
cout<<"n Enter the Item's Price : "; cin>>cb[total].Cost;
cout<<"n Enter the Item's History : "; gets(cb[total].His);
total++;
}
6: [29]
PROGRAM CODE
break;
default: cout<<"n Invalid Choice.";
} //End of Switch Case
char ok='n'; cin.ignore();
cout<<"n Would you like to see THE LIST? (Y/N) : ";
cin.get(ok); cin.ignore();
if(ok=='y' || ok=='Y')
{ cout<<"nn"; view(); }
}
void LIST::Sell()
{
cout<<"n Welcome Supplier.n How many items to sell?n ";
int noi; cin>>noi; //no of items to sell
cout<<endl;
for(int i=0; i<noi; i++)
{
cout<<"n Item To Sell No:"<<(i+1)<<"nn";
cout<<" Enter the Name of the Item: "; gets(s[stotal].Name);
cout<<"n Enter the Age of the Item: "; cin>>s[stotal].Age;
cout<<"n Enter your Selling Price: "; cin>>s[stotal].Cost;
cout<<"n Enter Item's History: "; gets(s[stotal].His);
stotal++;
}
cout<<"n Thank you for your offer. n";
}
6: [30]
PROGRAM CODE
// THE VOID MAIN FUNCTION:
void main()
{
int ch;
do
{
clrscr();
Space(74,"",'_'); cout<<endl;
Space(33,"",'_'); Space(41,"MAIN MENU",'_'); cout<<endl;
Space(25,"n 1. THE LIST");
Space(28," | Shows the List of items on Sale.");
cout<<endl;
Space(25,"n 2. THE HISTORY");
Space(28," | Learn more about an Item or Store");
cout<<endl;
Space(25,"n 3. THE SEARCH ");
Space(28," | Can't Find what you're looking for?",' ');
cout<<endl;
Space(25,"n 4. I AM A CUSTOMER");
Space(28," | Buy something nice for Yourself.");
cout<<endl;
Space(25,"n 5. I AM A SUPPLIER");
Space(28," | Sell us something We may like.");
cout<<endl;
Space(25,"n 6. I AM THE MANAGER");
Space(28," | A Password Protected Control Centre. ");
cout<<endl;
Space(25,"n 0. EXIT.");
Space(28," | Done here? Leave the Online Store.");
cout<<endl;
Space(74,"",'_');
cout<<"nn Your Choice (0-6): ";
cin>>ch; cin.ignore(); cout<<endl;
clrscr();
switch(ch)
{
case 1: ob.view(); break;
case 2: ob.viewHis(); break;
case 3: ob.Search(); break;
6: [31]
PROGRAM CODE
case 4:
cout<<endl;
Space(30,"_",'_'); Space(44,"I AM A CUSTOMER",'_'); cout<<endl;
cout<<endl;
ob.Buy();
cout<<endl;
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
case 5:
cout<<endl;
Space(30,"_",'_'); Space(44,"I AM A SUPPLIER",'_'); cout<<endl;
cout<<endl;
ob.Sell();
cout<<endl;
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
case 6: int ch2;
cout<<" Enter the Password: n ";
char ps[10]; gets(ps);
if(strcmp(ps,pass)==0)
{
cout<<"n Welcome Back Manager.nn";
do
{
clrscr();
cout<<endl;
Space(29,"_",'_'); Space(45,"I AM THE MANAGER",'_'); cout<<endl;
cout<<endl;
Space(33,"n 1. CHANGE THE PASSWORD ");
Space(20," | Be Safe & Secure. ");
cout<<endl;
Space(33,"n 2. ADD AN ITEM TO THE LIST ");
Space(20," | More items to add? ");
cout<<endl;
Space(33,"n 3. EDIT AN ITEM ON THE LIST ");
Space(20," | Make some Changes. ",' ');
cout<<endl;
Space(33,"n 4. DELETE AN ITEM FROM THE LIST");
6: [32]
PROGRAM CODE
Space(20," | Remove the Unwanted.");
cout<<endl;
Space(33,"n 5. USE THE CUBE CASHIER ");
Space(20," | Check. Deposit. Withdraw.");
cout<<endl;
Space(33,"n 0. EXIT.");
Space(20," | Done? Log out Safely.");
cout<<endl;
Space(74,"",'_');
cout<<"nn Your Choice (0-5): ";
cin>>ch2; cin.ignore(); cout<<endl;
clrscr();
cout<<endl;
Space(29,"_",'_'); Space(45,"I AM THE MANAGER",'_'); cout<<endl;
cout<<endl;
switch(ch2)
{
case 1: m1.PW(); break;
case 2: ob.ADD(); break;
case 3:
ob.EDIT();
cout<<endl;
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
case 4: ob.DEL(); break;
case 5: m1.CCash(); break;
case 0:
cout<<"n Thank you & Goodbye Manager! You Have been logged out
Safely. n";
cout<<endl;
Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_');
getch();
break;
default: cout<<"n INVALID CHOICE! RETRY! n";
}
}
while(ch2!=0);
6: [33]
PROGRAM CODE
}
else
{ cout<<"n Wrong Password!n "; getch(); }
break;
default: cout<<"nn Thank you For Visitng & Come Again Soon! ";
}
}while(ch!=0);
getch();
}
7: [1]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 1
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Hitler's Globe 76 3800000
#23033 Karl's Ink Pen 125 6250000
#23058 Katana of Shogan Tokugawa 414 20700000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
#23081 Sword of Tipu Sultan 87 4350000
See the next 10 items? (Y/N) : Y
#23091 The Pharaoh's Sceptre 124 6200000
#23096 Viking's Sledgehammer 168 8400000
___________________________[Enter To Continue]____________________________
7: [2]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 2
_______________________________THE HISTORY________________________________
Item No | Name of Item | Age| Cost|
#23022 Compass of Peter Tsar The Terrible 140 7000000
| HISTORY: The compass used by the famous conqueror
__________________________________________________________________________
#23023 Gustave's Blueprints 120 6000000
| HISTORY: The original blueprints of the Eiffel Tower
__________________________________________________________________________
#23032 Hitler's Globe 76 3800000
| HISTORY: The globe he used to strategize his conquests
__________________________________________________________________________
#23033 Karl's Ink Pen 125 6250000
| HISTORY: He wrote the Communist Manifesto with this pen
__________________________________________________________________________
#23058 Katana of Shogan Tokugawa 414 20700000
| HISTORY: The sword of the first Shogun of the Tokugawa clan
__________________________________________________________________________
See the next 5 items? (Y/N) : Y
_______________________________THE HISTORY________________________________
Item No | Name of Item | Age| Cost|
#23059 Mahatma Gandhi's Spectacles 62 3100000
| HISTORY: See the world through the eyes of this reputed freedom fighter
__________________________________________________________________________
#23067 Red Barron's Remains 96 4800000
| HISTORY: The famous fighter plane from World War 1
__________________________________________________________________________
#23076 Silver Claws Of Maharana 74 3700000
| HISTORY: The weapon he was most skilled in
__________________________________________________________________________
#23077 Stallon's Lost Diary 76 3800000
| HISTORY: The journal where he wrote his strategies and plans
__________________________________________________________________________
#23081 Sword of Tipu Sultan 87 4350000
| HISTORY: The sword he held before he met his death
7: [3]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
See the next 5 items? (Y/N) : Y
_______________________________THE HISTORY________________________________
Item No | Name of Item | Age| Cost|
#23091 The Pharaoh's Sceptre 124 6200000
| HISTORY: An Egyptian artefact that was a symbol of authority
__________________________________________________________________________
#23096 Viking's Sledgehammer 168 8400000
| HISTORY: A weapon of great power used by the Vikings
___________________________[Enter To Continue]____________________________
7: [4]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 3
_________________________________THE SEARCH_______________________________
Which entity to search in?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 1
Enter a Word to Search for: gLoBe
______________________________SEARCH RESULTS______________________________
Item No | Name of Item | Age| Cost|
#23032 Hitler's Globe 76 3800000
___________________________[Enter To Continue]____________________________
_________________________________THE SEARCH_______________________________
Which entity to search in?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 3
Enter the Upper Limit and Lower Limit. (Both Included in Search.)
Lower Limit: 0
Upper Limit: 1000000
[ 0 <--> 1000000 ]
______________________________SEARCH RESULTS______________________________
Item No | Name of Item | Age| Cost|
<<<< NO SUCH ITEM FOUND! >>>>
___________________________[Enter To Continue]____________________________
7: [5]
SAMPLE INPUT & OUTPUT
_________________________________THE SEARCH_______________________________
Which entity to search in?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 2
Enter the Upper Limit and Lower Limit. (Both Included in Search.)
Lower Limit: 100
Upper Limit: 200
[ 100 <--> 200 ]
______________________________SEARCH RESULTS______________________________
Item No | Name of Item | Age| Cost|
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23033 Karl's Ink Pen 125 6250000
#23091 The Pharaoh's Sceptre 124 6200000
#23096 Viking's Sledgehammer 168 8400000
___________________________[Enter To Continue]____________________________
_________________________________THE SEARCH_______________________________
Which entity to search in?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 4
Enter a Word to Search for: fighter
______________________________SEARCH RESULTS______________________________
Item No | Name of Item | Age| Cost|
#23059 Mahatma Gandhi's Spectacles 62 3100000
| History:
| See the world through the eyes of this reputed freedom fighter
...
#23067 Red Barron's Remains 96 4800000
| History:
| The famous fighter plane from World War 1
...
___________________________[Enter To Continue]____________________________
7: [6]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 4
______________________________I AM A CUSTOMER_____________________________
Enter the item number of the item you wish to buy
#23033
Buy Another item? (y/n) [MAX: 5 items per Bill]
Y
Enter the item number of the item you wish to buy
#23081
Buy Another item? (y/n) [MAX: 5 items per Bill]
N
____________________BILL__________________________
| Name | Cost
Karl's Ink Pen 6250000
Sword of Tipu Sultan 4350000
__________________________________________________
TOTAL: 10600000
Thank you for shopping at This Antique Store.
___________________________[Enter To Continue]____________________________
7: [7]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 1
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Hitler's Globe 76 3800000
#23058 Katana of Shogan Tokugawa 414 20700000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
#23091 The Pharaoh's Sceptre 124 6200000
#23096 Viking's Sledgehammer 168 8400000
___________________________[Enter To Continue]____________________________
7: [8]
SAMPLE INPUT & OUTPUT
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 5
______________________________I AM A SUPPLIER_____________________________
Welcome Supplier.
How many items to sell?
2
Item To Sell No:1
Enter the Name of the Item: The Orb of Galactus
Enter the Age of the Item: 68
Enter your Selling Price: 5000000
Enter Item's History: The power of the cosmos trapped in an orb
Item To Sell No:2
Enter the Name of the Item: The Toothpick of Gibralter
Enter the Age of the Item: 45
Enter your Selling Price: 5600000
Enter Item's History: It still holds the piece of lettuce he pulled out
Thank you for your offer.
___________________________[Enter To Continue]____________________________
7: [9]
SAMPLE INPUT & OUTPUT
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 6
Enter the Password:
Hamburger
_____________________________I AM THE MANAGER_____________________________
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 1
_____________________________I AM THE MANAGER_____________________________
Please enter the new Password (10 char)
pass
Your Password has been Changed from " Hamburger " to " pass " .
___________________________[Enter To Continue]____________________________
7: [10]
SAMPLE INPUT & OUTPUT
_____________________________I AM THE MANAGER_____________________________
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 2
_____________________________I AM THE MANAGER_____________________________
TO ADD AN ITEM TO THE STORE.
1. From Supplier
2. From Manager.
Your Choice (1-2) : 1
Item #1
Name of Item : The Orb of Galactus
Age of Item : 68
Asked Price : 5000000
History : The power of the cosmos trapped in an orb
ACCEPT OR DECLINE? (A/D): D
Item is Declined.
Item #2
Name of Item : The Toothpick of Gibralter
Age of Item : 45
Asked Price : 5600000
History : It still holds the piece of lettuce he pulled out
ACCEPT OR DECLINE? (A/D): A
Enter the Item No of new Item:
#23077
Entered Item Number Already Exists. RETRY!
Enter the Item No of new Item:
#23078
Enter the new Item's Price:
7000000
No More Items By Supplier.
Would you like to see THE LIST? (Y/N) : Y
7: [11]
SAMPLE INPUT & OUTPUT
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Hitler's Globe 76 3800000
#23058 Katana of Shogan Tokugawa 414 20700000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
#23078 The Toothpick of Gibralter 45 7000000
#23091 The Pharaoh's Sceptre 124 6200000
See the next 10 items? (Y/N) : N
___________________________[Enter To Continue]____________________________
_____________________________I AM THE MANAGER_____________________________
TO ADD AN ITEM TO THE STORE.
1. From Supplier
2. From Manager.
Your Choice (1-2) : 2
How many items to add? : 2
Item To Add (1/2)
Enter the Item No of new Item : #23001
Enter the Name of the Item : Boomerang of Alura
Enter the Age of the Item : 89
Enter the Item's Price : 6900000
Enter the Item's History : Weapon used by Alura for hunt and battle
Item To Add (2/2)
Enter the Item No of new Item : #23004
Enter the Name of the Item : Book of Odis
Enter the Age of the Item : 550
Enter the Item's Price : 8000000
Enter the Item's History : The book of spells according to Norse
Mythology
Would you like to see THE LIST? (Y/N) : Y
7: [12]
SAMPLE INPUT & OUTPUT
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23001 Boomerang of Alura 89 6900000
#23004 Book of Odis 550 8000000
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Hitler's Globe 76 3800000
#23058 Katana of Shogan Tokugawa 414 20700000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
See the next 10 items? (Y/N) : Y
#23078 The Toothpick of Gibralter 45 7000000
#23091 The Pharaoh's Sceptre 124 6200000
#23096 Viking's Sledgehammer 168 8400000
___________________________[Enter To Continue]____________________________
7: [13]
SAMPLE INPUT & OUTPUT
_____________________________I AM THE MANAGER_____________________________
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 3
_____________________________I AM THE MANAGER_____________________________
Enter the Item No of the Item to Edit
#23032
Which entity do you want to edit?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 1
Enter the new Name: Globe of Adolf Hitler
Any more EDITs on this item? (Y/N) : Y
Which entity do you want to edit?
1. Name
2. Age
3. Cost
4. History
Your Choice (1-4) : 2
Enter the new Age: 81
Any more EDITs on this item? (Y/N) : N
Your EDITING has been successful!
Would you like to see THE LIST? (Y/N)
Y
7: [14]
SAMPLE INPUT & OUTPUT
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23001 Boomerang of Alura 89 6900000
#23004 Book of Odis 550 8000000
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Globe of Adolf Hitler 81 3800000
#23058 Katana of Shogan Tokugawa 414 20700000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
See the next 10 items? (Y/N) : N
___________________________[Enter To Continue]____________________________
_____________________________I AM THE MANAGER_____________________________
7: [15]
SAMPLE INPUT & OUTPUT
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 4
_____________________________I AM THE MANAGER_____________________________
Enter the item number of the item you wish to delete.
#23058
The Item has been deleted.
Would you like to see THE LIST? (Y/N)
Y
_________________________________THE LIST_________________________________
Item No | Name of Item | Age| Cost|
#23001 Boomerang of Alura 89 6900000
#23004 Book of Odis 550 8000000
#23022 Compass of Peter Tsar The Terrible 140 7000000
#23023 Gustave's Blueprints 120 6000000
#23032 Globe of Adolf Hitler 81 3800000
#23059 Mahatma Gandhi's Spectacles 62 3100000
#23067 Red Barron's Remains 96 4800000
#23076 Silver Claws Of Maharana 74 3700000
#23077 Stallon's Lost Diary 76 3800000
#23078 The Toothpick of Gibralter 45 7000000
See the next 10 items? (Y/N) : Y
#23091 The Pharaoh's Sceptre 124 6200000
#23096 Viking's Sledgehammer 168 8400000
___________________________[Enter To Continue]____________________________
7: [16]
SAMPLE INPUT & OUTPUT
_____________________________I AM THE MANAGER_____________________________
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 5
_____________________________I AM THE MANAGER_____________________________
Welcome to The Cube Cashier.
Choose Among The Options Below:
1. View Balance
2. Deposit
3. Withdraw
Your Choice (1-3) :1
The Balance in your Account: 2437783003
Exit Cube Cashier? (Y/N) :N
Choose Among The Options Below:
1. View Balance
2. Deposit
3. Withdraw
Your Choice (1-3) :3
How much money to withdraw from Account?
7783003
The Balance in your Account: 2430000000
Exit Cube Cashier? (Y/N) : Y
7: [17]
SAMPLE INPUT & OUTPUT
_____________________________I AM THE MANAGER_____________________________
1. CHANGE THE PASSWORD | Be Safe & Secure.
2. ADD AN ITEM TO THE LIST | More items to add?
3. EDIT AN ITEM ON THE LIST | Make some Changes.
4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted.
5. USE THE CUBE CASHIER | Check. Deposit. Withdraw.
0. EXIT. | Done? Log out Safely.
__________________________________________________________________________
Your Choice (0-5): 0
_____________________________I AM THE MANAGER_____________________________
Thank you & Goodbye Manager! You Have been logged out Safely.
___________________________[Enter To Continue]____________________________
__________________________________________________________________________
_________________________________MAIN MENU________________________________
1. THE LIST | Shows the List of items on Sale.
2. THE HISTORY | Learn more about an Item or Store
3. THE SEARCH | Can't Find what you're looking for?
4. I AM A CUSTOMER | Buy something nice for Yourself.
5. I AM A SUPPLIER | Sell us something We may like.
6. I AM THE MANAGER | A Password Protected Control Centre.
0. EXIT. | Done here? Leave the Online Store.
__________________________________________________________________________
Your Choice (0-6): 0
Thank you For Visiting & Come Again Soon!
8: [1]
BIBLIOGRAPHY
COMPUTER SCIENCE WITH C++
SUMITA ARORA1
2
3
HTTP://CPLUSPLUS.COM
HTTP://TDOCPP.CO.CC
9: [1]
There are a number of possibilities to make this software better.
After learning the usage and application of graphics, I plan on further
improving the interactive nature of the software. The menu would have
clickable buttons rather than typed in choices and by introducing the
mouse pointer, selection of those options would be far more convenient.
I also intend on introducing selective functionality through user
accounts. This would provide more options for suppliers and managers.
A Supplier can make an account, send an offer and be updated on the
manager’s decision as well. This would be possible only with user
accounts where the supplier can be identified by their username. Also, if
the store is run by more than one person and each person is assigned a
specific task to play, user accounts will be able to divide the manager
options accordingly.
As of now, its functions are restricted to those of an Antique Store. I
plan to generalize it so that it can be used in any type of store allowing
the manager to choose which fields and options are most suitable for his
store.
The next thing would be to encrypt the data files. Presently, the files
store the details of the items on sale, the balance of the store and the
password to access the manager options. These can be easily accessed
using a notepad in windows. To prevent this, the files should be
encrypted so that those who do try to read the data will not be able to
make sense of it, and making the files Read Only can prevent offenders
from changing the information.
Unfortunately, this software is mainly just recording changes in the
store with transactions. With much further study, I can implement it in
the real world. Rather than recording the money moving from one
account to another, the software can be made to access the bank
accounts and allow the transaction of actual money.
SCOPE FOR FUTURE EXPANSION
NEIL MATHEW
XII B 13
DON BOSCO SCHOOL

More Related Content

Similar to The Cube - Class XII Project

THE CUBE: Antique Store
THE CUBE: Antique StoreTHE CUBE: Antique Store
THE CUBE: Antique Store
Neil Mathew
 
FP304 DATABASE SYSTEM FINAL PAPER
FP304    DATABASE SYSTEM FINAL PAPERFP304    DATABASE SYSTEM FINAL PAPER
FP304 DATABASE SYSTEM FINAL PAPER
Syahriha Ruslan
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
Lori Moore
 
Inventory management system
Inventory management systemInventory management system
Inventory management system
Md. Syful Azam
 
Inventory management system
Inventory management systemInventory management system
Inventory management system
pavanwalecha
 
inventory management system
 inventory management system inventory management system
inventory management system
Barbara Onwutalobi
 
1 WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2 L.docx
1  WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2  L.docx1  WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2  L.docx
1 WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2 L.docx
teresehearn
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
Baileya126
 
TSQL Functions (SQL Server)
TSQL Functions (SQL Server)TSQL Functions (SQL Server)
TSQL Functions (SQL Server)
Steve Stedman
 
Feature guide opportunity manager(awom)
Feature guide   opportunity manager(awom)Feature guide   opportunity manager(awom)
Feature guide opportunity manager(awom)Ajeet Singh
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docx
mary772
 
CT2K-Reports_bdbupdated_031014.pptx
CT2K-Reports_bdbupdated_031014.pptxCT2K-Reports_bdbupdated_031014.pptx
CT2K-Reports_bdbupdated_031014.pptx
brianbrowne13
 
Microsoft Project - MSP | 2013-2016
Microsoft Project - MSP | 2013-2016Microsoft Project - MSP | 2013-2016
Microsoft Project - MSP | 2013-2016
Rajeev Sharma
 
5952 database systems administration (comp 1011.1)-cw1
5952   database systems administration (comp 1011.1)-cw15952   database systems administration (comp 1011.1)-cw1
5952 database systems administration (comp 1011.1)-cw1
saeedkhan841514
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
Baileyao
 
OracleSQLTuning.ppt
OracleSQLTuning.pptOracleSQLTuning.ppt
OracleSQLTuning.ppt
RahulP959616
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.com
DavisMurphyB33
 
Lsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishnaLsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishna
Hari Krishna
 

Similar to The Cube - Class XII Project (20)

THE CUBE: Antique Store
THE CUBE: Antique StoreTHE CUBE: Antique Store
THE CUBE: Antique Store
 
FP304 DATABASE SYSTEM FINAL PAPER
FP304    DATABASE SYSTEM FINAL PAPERFP304    DATABASE SYSTEM FINAL PAPER
FP304 DATABASE SYSTEM FINAL PAPER
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
 
Inventory management system
Inventory management systemInventory management system
Inventory management system
 
Inventory management system
Inventory management systemInventory management system
Inventory management system
 
inventory management system
 inventory management system inventory management system
inventory management system
 
1 WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2 L.docx
1  WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2  L.docx1  WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2  L.docx
1 WEEK # 2 - EXERCISES CHAPTER # 5 Exercise 2 L.docx
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
 
TSQL Functions (SQL Server)
TSQL Functions (SQL Server)TSQL Functions (SQL Server)
TSQL Functions (SQL Server)
 
Feature guide opportunity manager(awom)
Feature guide   opportunity manager(awom)Feature guide   opportunity manager(awom)
Feature guide opportunity manager(awom)
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docx
 
CT2K-Reports_bdbupdated_031014.pptx
CT2K-Reports_bdbupdated_031014.pptxCT2K-Reports_bdbupdated_031014.pptx
CT2K-Reports_bdbupdated_031014.pptx
 
Microsoft Project - MSP | 2013-2016
Microsoft Project - MSP | 2013-2016Microsoft Project - MSP | 2013-2016
Microsoft Project - MSP | 2013-2016
 
5952 database systems administration (comp 1011.1)-cw1
5952   database systems administration (comp 1011.1)-cw15952   database systems administration (comp 1011.1)-cw1
5952 database systems administration (comp 1011.1)-cw1
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
 
It ready dw_day4_rev00
It ready dw_day4_rev00It ready dw_day4_rev00
It ready dw_day4_rev00
 
OracleSQLTuning.ppt
OracleSQLTuning.pptOracleSQLTuning.ppt
OracleSQLTuning.ppt
 
BrownbagIntrotosqltuning.ppt
BrownbagIntrotosqltuning.pptBrownbagIntrotosqltuning.ppt
BrownbagIntrotosqltuning.ppt
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.com
 
Lsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishnaLsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishna
 

More from Neil Mathew

AMIZONER: Weekly Progress Reports
AMIZONER: Weekly Progress ReportsAMIZONER: Weekly Progress Reports
AMIZONER: Weekly Progress Reports
Neil Mathew
 
AMIZONER: Final Report
AMIZONER: Final ReportAMIZONER: Final Report
AMIZONER: Final Report
Neil Mathew
 
Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics Lab
Neil Mathew
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
Neil Mathew
 
Role of IT & Computer in Environment
Role of IT & Computer in EnvironmentRole of IT & Computer in Environment
Role of IT & Computer in Environment
Neil Mathew
 
French Open
French OpenFrench Open
French Open
Neil Mathew
 
Data Structures Lab
Data Structures LabData Structures Lab
Data Structures Lab
Neil Mathew
 
DBMS Lab
DBMS LabDBMS Lab
DBMS Lab
Neil Mathew
 
Communication Assessment File
Communication Assessment FileCommunication Assessment File
Communication Assessment File
Neil Mathew
 
Cloud Computing and Google's advancement in the field
Cloud Computing and Google's advancement in the fieldCloud Computing and Google's advancement in the field
Cloud Computing and Google's advancement in the field
Neil Mathew
 
Unix Programming Lab
Unix Programming LabUnix Programming Lab
Unix Programming Lab
Neil Mathew
 
Copywriting & Storyboarding (Advertising & Sales Promotion)
Copywriting & Storyboarding (Advertising & Sales Promotion)Copywriting & Storyboarding (Advertising & Sales Promotion)
Copywriting & Storyboarding (Advertising & Sales Promotion)
Neil Mathew
 
American Airlines Merger (Management In Action Case Study)
American Airlines Merger (Management In Action Case Study)American Airlines Merger (Management In Action Case Study)
American Airlines Merger (Management In Action Case Study)
Neil Mathew
 
Good Governance Leads To Flourish Society & Nation (BS SAP)
Good Governance Leads To Flourish Society & Nation (BS SAP)Good Governance Leads To Flourish Society & Nation (BS SAP)
Good Governance Leads To Flourish Society & Nation (BS SAP)
Neil Mathew
 
High Fortune (Product Brand Management)
High Fortune (Product Brand Management)High Fortune (Product Brand Management)
High Fortune (Product Brand Management)
Neil Mathew
 
Cost Benefit Analysis in Public Project Appraisal (PPAC)
Cost Benefit Analysis in Public Project Appraisal (PPAC)Cost Benefit Analysis in Public Project Appraisal (PPAC)
Cost Benefit Analysis in Public Project Appraisal (PPAC)
Neil Mathew
 
Corportate Entrepreneurship at WIPRO
Corportate Entrepreneurship at WIPROCorportate Entrepreneurship at WIPRO
Corportate Entrepreneurship at WIPRO
Neil Mathew
 
Consumer Perception of Job Seekers in updating their Job Profiles on Job Portals
Consumer Perception of Job Seekers in updating their Job Profiles on Job PortalsConsumer Perception of Job Seekers in updating their Job Profiles on Job Portals
Consumer Perception of Job Seekers in updating their Job Profiles on Job Portals
Neil Mathew
 
How OLX changed the consumer involvement in the Scrap Market
How OLX changed the consumer involvement in the Scrap MarketHow OLX changed the consumer involvement in the Scrap Market
How OLX changed the consumer involvement in the Scrap Market
Neil Mathew
 
Innovation Jockeys 3 - Gramseva: Kisan
Innovation Jockeys 3 - Gramseva: KisanInnovation Jockeys 3 - Gramseva: Kisan
Innovation Jockeys 3 - Gramseva: Kisan
Neil Mathew
 

More from Neil Mathew (20)

AMIZONER: Weekly Progress Reports
AMIZONER: Weekly Progress ReportsAMIZONER: Weekly Progress Reports
AMIZONER: Weekly Progress Reports
 
AMIZONER: Final Report
AMIZONER: Final ReportAMIZONER: Final Report
AMIZONER: Final Report
 
Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics Lab
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
 
Role of IT & Computer in Environment
Role of IT & Computer in EnvironmentRole of IT & Computer in Environment
Role of IT & Computer in Environment
 
French Open
French OpenFrench Open
French Open
 
Data Structures Lab
Data Structures LabData Structures Lab
Data Structures Lab
 
DBMS Lab
DBMS LabDBMS Lab
DBMS Lab
 
Communication Assessment File
Communication Assessment FileCommunication Assessment File
Communication Assessment File
 
Cloud Computing and Google's advancement in the field
Cloud Computing and Google's advancement in the fieldCloud Computing and Google's advancement in the field
Cloud Computing and Google's advancement in the field
 
Unix Programming Lab
Unix Programming LabUnix Programming Lab
Unix Programming Lab
 
Copywriting & Storyboarding (Advertising & Sales Promotion)
Copywriting & Storyboarding (Advertising & Sales Promotion)Copywriting & Storyboarding (Advertising & Sales Promotion)
Copywriting & Storyboarding (Advertising & Sales Promotion)
 
American Airlines Merger (Management In Action Case Study)
American Airlines Merger (Management In Action Case Study)American Airlines Merger (Management In Action Case Study)
American Airlines Merger (Management In Action Case Study)
 
Good Governance Leads To Flourish Society & Nation (BS SAP)
Good Governance Leads To Flourish Society & Nation (BS SAP)Good Governance Leads To Flourish Society & Nation (BS SAP)
Good Governance Leads To Flourish Society & Nation (BS SAP)
 
High Fortune (Product Brand Management)
High Fortune (Product Brand Management)High Fortune (Product Brand Management)
High Fortune (Product Brand Management)
 
Cost Benefit Analysis in Public Project Appraisal (PPAC)
Cost Benefit Analysis in Public Project Appraisal (PPAC)Cost Benefit Analysis in Public Project Appraisal (PPAC)
Cost Benefit Analysis in Public Project Appraisal (PPAC)
 
Corportate Entrepreneurship at WIPRO
Corportate Entrepreneurship at WIPROCorportate Entrepreneurship at WIPRO
Corportate Entrepreneurship at WIPRO
 
Consumer Perception of Job Seekers in updating their Job Profiles on Job Portals
Consumer Perception of Job Seekers in updating their Job Profiles on Job PortalsConsumer Perception of Job Seekers in updating their Job Profiles on Job Portals
Consumer Perception of Job Seekers in updating their Job Profiles on Job Portals
 
How OLX changed the consumer involvement in the Scrap Market
How OLX changed the consumer involvement in the Scrap MarketHow OLX changed the consumer involvement in the Scrap Market
How OLX changed the consumer involvement in the Scrap Market
 
Innovation Jockeys 3 - Gramseva: Kisan
Innovation Jockeys 3 - Gramseva: KisanInnovation Jockeys 3 - Gramseva: Kisan
Innovation Jockeys 3 - Gramseva: Kisan
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

The Cube - Class XII Project

  • 1.
  • 2. This is to certify that Neil Mathew, Roll No: _____ , has successfully completed his Project under my guidance and has fulfilled the requirements for the submission of this project. Ms. Geetu Munjal, _________________ CERTIFICATE
  • 3. CONTENTS S No: Name: Page No: 1 ACKNOWLEDGEMENT 1 [ 1 - 1 ] 2 INTRODUCTION 2 [ 1-2 ] 3 THE 6 FACES OF THE CUBE 3 [ 1–2 ] 4 FLOW CHART DIAGRAM 4 [ 1-4 ] 5 USER DEFINED FUNCTIONS 5 [ 1-1 ] 6 PROGRAM CODE 6 [ 1-17 ] 7 SAMPLE INPUT & OUTPUT 7 [ 1-33 ] 8 BIBLIOGRAPHY 8 [ 1-1 ] 9 SCOPE FOR FUTURE EXPANSION 9 [ 1-1 ]
  • 4. 1: [1] ACKNOWLEDGEMENT I am indebted to my computer teacher, Ms Geetu Munjal for her guidance and whole hearted support in the making of this project.
  • 5. 2:[1] I call this software ‘THE CUBE’. This is mainly because of the fact that it performs 6 types of tasks. Three of them are general while the other three are user specific. The Cube is made for 3 types of users: A Customer, A Supplier and The Manager. A more elaborate coverage of The Cube’s function can be seen in ‘THE 6 FACES OF THE CUBE”. INTRODUCTION This software is made to cover the processes associated with an Antique Store. Its applications extend to customers, suppliers, cashiers, managers and other staff members alike. Besides allowing us to view and search the items on sale, its main priority is maintaining a record of the transaction of money and items. With a buy, an item is lost and its price is added to the store balance. Similarly, If the manager was to accept a Supplier’s offer, that items asked price would be subtracted from the store balance and be added to the list of items on sale. This allows the Store to have a constantly updated reference to check the progress of the store.
  • 6. 2: [2] INTRODUCTION To make it implementable in the real world, I have ensured that: (1) Data is stored in files and opened in binary mode for speed. (2) The interface has been made interactive and user friendly. (3) It has covered all possible threats to efficacy by means of Intensive Exception Handling like: (i) Invalid Entries by User (ii) An Advanced Search that is NOT case sensitive. (iii) And many others like: Maintaining transfer of cash through sale and purchase of the store, Maintaining Transfer of Data from Supplier Offer to Item On Sale, etc
  • 7. 3: [1] THE LIST This is a Tabular representation of the list of items on sale in the store. The following 4 entities are displayed here.  The Item number  The Name  The Age (in Years)  The Cost SPACING TOOL There is a function which is responsible for the tabular format of THE LIST. 1 THE HISTORY 2 This is a more detailed view of the items in THE LIST. It not only gives the 4 entities in THE LIST but also shows the history of the item and its significance in the past. However, only a limited number of items can be seen at a time. THE SEARCH 3 This allows users to search for an item, making it much easier than going through the long list to find something specific. The search allows us to narrow down the list by  Providing Ranges in the Cost and Age  A word search for Name and History. THE 6 FACES OF THE CUBE This is a more elaborate explanation of THE CUBE and the various tasks that it performs.
  • 8. 3: [2] I AM A CUSTOMER Once the money transfer is complete:  A bill for the user will be displayed.  There will be an increase in the store balance.  The item will be removed from THE LIST. 4 I AM A SUPPLIER 5 The user will have to enter the details of the item he wishes to sell including the price he is asking for it. This will be stored and decided later by the manager. I AM THE MANAGER 6 This option is for the manager. Since this is restricted to the general public, it is password protected. The Manager has the most number of options. He can add, delete and edit an item on THE LIST. He can change the password and access the CUBE CASHIER. THE 6 FACES OF THE CUBE This is one of the 3 user specific options. If this is chosen, the user will be able to choose and buy the item of his choice. CUBE CASHIER This is a money organizer for the store. When an item is sold or bought by the store, the balance increases and decreases accordingly. This option is for those who have something to sell to the store. When the manager accepts:  The item will be added to the LIST.  There will be a decrease in the store balance.
  • 9. FLOW CHART DIAGRAM START DISPLAY THE VARIOUS OPTIONS: (1) THE LIST | (2) THE HISTORY | (3) THE SEARCH | | (4) I AM A CUSTOMER | (5) I AM A SUPPLIER | (6) I AM THE MANAGER CHOOSE (Input Ch) RESTART THE DO WHILE LOOP 421 3 5 6 IF CH=1 || CH=2 || CH=3 || CH=4 || CH=5 || CH=6 || CH=0 Ch=1 Ch=2 Ch=3 Ch=4 Ch=5 Ch=6 ELSE END Ch=0 SHOW ERROR MESSAGE 0
  • 10. 1 void view() SHOWS THE LIST OF ITEMS void Space() PROVIDES TABULAR FORMAT FOR THE LIST void SORT_LIST() SORTS THE LIST ACCORDING TO ASCENDING ITEMNO 2 void viewHis() SHOWS THE LIST OF ITEMS WITH HISTORY OF EACH Call Call Call Call 3 DISPLAYS THE VARIOUS OPTIONS | PROVIDE RANGES IN (1) AGE (2) COST | A WORD SEARCH FOR (3) NAME OF ITEM (4) HISTORY CHOOSE (Input Ch) IF CH=1 || CH=2 || CH=3 || CH=4 ELSE Ch=1 Ch=2 Ch=3 SHOW ERROR MESSAGE Ch=4 0 0 0 ASKS FOR UPPER LIMIT & LOWER LIMIT THEN DISPLAYS THE SEARCH RESULTS ASKS FOR THE WORD TO SEARCH FOR THEN DISPLAYS THE SEARCH RESULTS ASKS FOR UPPER LIMIT & LOWER LIMIT THEN DISPLAYS THE SEARCH RESULTS ASKS FOR THE WORD TO SEARCH FOR THEN DISPLAYS THE SEARCH RESULTS FLOW CHART DIAGRAM
  • 11. 5 SHOW ASKS HOW MANY ITEMS THE SUPPLIER IS WILLIING TO SELL. ENTER (Input num) SHOW: ASKS FOR ITEM NO: TO BUY: 4 ENTER ITEMNO (INPUT CHK) TRUE IF CHK COINCIDES WITH EXISTING ITEM NO FALSE SHOW: ASKS WHETHER TO BUY MORE? (y/n) ENTER (INPUT OK) TRUE IF OK = ‘Y’ || OK= ‘y’ FALSE SHOW: THE BILL OF ALL ITEMS PURCHASED 0 SHOW: SHOW WHICH ALL DETAILS OF ITEM IS REQUIRED: IF num LOOPS ARE COMPLETED. ENTER THE DETAILS FALSE FLOW CHART DIAGRAM
  • 12. FLOW CHART DIAGRAM 6 DISPLAYS THE VARIOUS OPTIONS | (1) CHANGE YOUR PASSWORD. | (2) ADD AN ITEM TO THE LIST. | (3) DELETE AN ITEM ON THE LIST. | (4) EDIT AN ITEM ON THE LIST. | (5) USE THE CUBE CASHIIER | (0) EXIT SHOW “ENTER PASSWORD” SHOW “WRONG PASSWORD” IF PW == PASS ENTER (Input PW) FALSE TRUECHOOSE (Input Ch) IF CH=1 || CH=2 || CH=3 || CH=4 || CH=5 || CH=0 ELSE 0 Ch=0 CHANGES THE STRING STORED IN PASS OF CLASS MANAGER WHICH IS LATER STORED INTO A DATAFILE. Ch=1 void ADD() ALLOWS MANAGER TO ADD RECORDS/ITEMS FROM (1) SUPPLIER (HIS ITEMS’S DETAILS ARE SHOWN AND USER CAN ACCEPT OR DECLINE THE SUPPLIER’S OFFER ) (2) FROM MANAGER ( HE CAN ADD THE ITEMS HIMSELF TO THE STORE ) void EDIT() ACCORDING TO THE ITEM NO INPUTTED, DETAILS CAN BE CHANGED void DEL() ACCORDING TO THE ITEM NO INPUTTED, ITEM & ITS DETAILS ARE DELETED.void CCASH() ALLOWS USER TO VIEW, DEPOSIT AND WITHDRAW FROM HIS STORES’ BALANCE 0 Ch=4 Ch=3 Ch=5 Ch=2
  • 13. 5: [1] . OTHERS10 I AM THE MANAGER16 I AM A SUPPLIER15 I AM A CUSTOMER14 THE SEARCH 13 THE HISTORY12 THE LIST1 VOID VIEW() - DISPLAYS THE ITEMS IN TABULAR FORMAT VOID VIEWHIS() - SHOWS THE HISTORY OF THE ITEM VOID SEARCH() - FINDS AN ITEM BY SEARCHING FOR KEYWORDS IN NAME, AND RANGE IN AGE AND COST VOID BUY() - ALLOWS USER TO BUY ITEMS ON THE LIST  VOID PW() – CHANGES PASSWORD TO ENTER THIS  VOID CCASH() – CUBE CASHIER ALLOWING USER TO DEPOSIT, WITHDRAW AND VIEW STORE’S BALANCE  VOID EDIT() – EDITS INFO OF EXISTING ITEM IN LIST  VOID ADD() – ADDS AN ITEM TO LIST (INDIRECTLY FROM SUPPLIER OR DIRECTLY FROM MANAGER)  VOID DEL() – DELETES AN EXISTING ITEM FROM LIST VOID SELL() - ALLOWS USER TO SELL ITEMS TO STORE  VOID SPACE() – RESPONSIBLE FOR PROPER SPACING OF STRINGS AND INTEGERS (FUNCTION OVERLOADING)  INT FIND_IT() – FINDS THE POSITION OF THE ITEM IN THE ARRAY BY COMPARING ITEM NUMBERS AND RETURNS IT  VOID REMOVE_IT() – REMOVES THE ITEM FROM THE LIST. BOTH DEL() AND BUY() CALLS THIS FUNCTION  VOID SORT_LIST() – SORTS THE ITEMS IN THE LIST VOID ALL_IN() – WRITES ALL INFO INTO DATAFILE VOID ALL_OUT() – READS ALL INFO INTO PROGRAM USER DEFINED FUNCTIONS
  • 14. 6: [1] PROGRAM CODE #include<fstream.h> #include<stdio.h> #include<string.h> #include<conio.h> #include<ctype.h> #include<dos.h> //SPACING TOOL OVERLOADED FUNCTIONS //For Strings: void Space(int n,char str[40],char sp=' ') { /* There is a fixed number of places(n), and after the string (str) is displayed, the remaining places are filled with spaces OR a char (sp). This allows the data to be shown more aligned. */ int i; cout.write(str,strlen(str)); int L=(n-strlen(str)); for(i=1; i<=L; i++) { cout<<sp; } } //For Unsigned Long: void Space(int n, unsigned long a) { /* Same concept as above BUT a different arrangement for Nos. From the fixed number of places(n), the number (a) is displayed at the end rather than the beginning as for strings. */ unsigned long i=a; int count=0; do { i=i/10; count++; } while(i>0); for(i=1; i<=(n-count); i++) putchar(' '); cout<<a; }
  • 15. 6: [2] PROGRAM CODE //For Integers. void Space(int n, int a) { int i=a; int count=0; do { i=i/10; count++; } while(i>0); for(i=1; i<=((n-count)); i++) putchar(' '); cout<<a; }
  • 16. 6: [3] PROGRAM CODE //GLOBAL MEMBERS int total; void count(); void ALL_IN(); void ALL_OUT(); //THE CLASS LIST STARTS HERE: class LIST { public: char itmNo[40]; char Name[40]; int Age; unsigned long Cost; char His[100]; LIST() { clrscr(); //Creation of datafile if program opened for first time: fstream f; f.open( "CB_LIST.DAT", ios::out | ios::noreplace ); f.close(); count(); ALL_IN(); } ~LIST() { ALL_OUT(); } void view(); //Displays the List in tabular form void viewHis(); //Displays List with History void Search(); //Search an item on List. void Buy(); //Deletes an item (Customer Option) void Sell(); /*Saves the details of the item to sell for consideration (Supplier Option) */ void DEL(); //Deletes an item (Manager Option) void ADD(); //Adds an item (Manager Option) void EDIT(); //Edits an existing item (Manager Option) private: void SORT_LIST(); //Sorts the items in the LIST acc to Item No. int Find_it(char [40]); //Finds the pos of item to delete w.r.t Item No. void Remove_it(char [40]); //Removes an item from the List }cb[200],ob;
  • 17. 6: [4] PROGRAM CODE //GLOBAL MEMBERS int stotal; void scount(); void sALL_IN(); void sALL_OUT(); // THE CLASS Sup STARTS HERE: class Sup { public: char Name[40]; int Age; unsigned long Cost; char His[100]; Sup() { //Creation of datafile if program opened for first time: fstream f; f.open( "CB_SALE.DAT", ios::out | ios::noreplace | ios::binary); f.close(); scount(); sALL_IN(); } ~Sup() { sALL_OUT(); } }s[20],sob,sob2;
  • 18. 6: [5] PROGRAM CODE //GLOBAL MEMBERS void PASS_IN(); void PASS_OUT(); void BAL_IN(); void BAL_OUT(); // THE CLASS MNGR STARTS HERE: unsigned long bal; //balance char pass[10]; //password class Mngr { public: unsigned long dw; //deposit or withdraw. Mngr() { //Creation of datafile if program opened for first time: fstream f; f.open( "CB_PASS.DAT", ios::out | ios::noreplace ); f.close(); fstream f2; f2.open( "CB_BAL.DAT", ios::out | ios::noreplace ); f2.close(); PASS_IN(); //Retrieves the password from a datafile BAL_IN(); //Retrieves the current store balance from a datafile } ~Mngr() { PASS_OUT(); //Sends the password into a datafile BAL_OUT(); //Sends the current store balance into a datafile } void PW(); //Function that changes the password void Cview(); //Function that shows Store Balance void Cdep(unsigned long); //Function that allows us to deposit money void Cwid(unsigned long); //Function that allows us to withdraw money void CCash(); // Function that opens the menu for CUBE CASHIER } m1;
  • 19. 6: [6] PROGRAM CODE // THE FUNCTIONS THAT WORK WITH DATA FILES. // Function count Finds No of Items in Store void count() { fstream f; f.open( "CB_LIST.DAT", ios::in | ios::binary ); int counter=0; while( ! f.eof() ) { f.read((char*)&sob, sizeof(LIST)); counter++; }; counter--; //since one record extra is always counted. f.close(); total=counter; } // Reads the data from the datafile and Stores the values intohe array objects. void ALL_IN() { fstream chew; chew.open( "CB_LIST.DAT", ios::in | ios::binary ); int i=0; while( i<total ) { chew.read((char*)&ob, sizeof(ob)); strcpy(cb[i].itmNo, ob.itmNo); strcpy(cb[i].Name, ob.Name); cb[i].Age=ob.Age; cb[i].Cost=ob.Cost; strcpy(cb[i].His, ob.His ); i++; }; chew.close(); }
  • 20. 6: [7] PROGRAM CODE // Writes the data from the array objects into the data file. void ALL_OUT() { fstream blow; blow.open( "CB_LIST.DAT", ios::out | ios::binary | ios::trunc ); int i=0; while( i<total ) { blow.write((char*)&cb[i], sizeof(LIST)); i++; }; blow.close(); } // Counts the no of Supplier offers for the manager to decide on later. void scount() { fstream f; f.open( "CB_SALE.DAT", ios::in | ios::binary ); int counter=0; while( ! f.eof() ) { f.read((char*)&sob2, sizeof(sob2)); counter++; }; counter--; //since one record extra is always counted. f.close(); stotal=counter; }
  • 21. 6: [8] PROGRAM CODE // Reads the data from the data file and Stores the values into the array objects. void sALL_IN() { fstream chew; chew.open( "CB_SALE.DAT", ios::in | ios::binary ); int i=0; while( i < stotal ) { chew.read((char*)&sob, sizeof(sob)); strcpy(s[i].Name, sob.Name); s[i].Age=sob.Age; s[i].Cost=sob.Cost; strcpy(s[i].His, sob.His ); i++; }; chew.close(); } // Writes the data from the array objects into the data file. void sALL_OUT() { fstream blow; blow.open( "CB_SALE.DAT", ios::out | ios::binary | ios::trunc ); int i=0; while( i< stotal ) { blow.write((char*)&s[i], sizeof(LIST)); i++; }; blow.close(); }
  • 22. 6: [9] PROGRAM CODE // Retrieves the store balance from the Data File. void BAL_IN() { fstream chew; chew.open( "CB_BAL.DAT", ios::in); chew>>bal; chew.close(); } // Stores the Store Balance into the Data File. void BAL_OUT() { fstream blow; blow.open( "CB_BAL.DAT", ios::out | ios::binary | ios::trunc ); blow<<bal; blow.close(); } // Retrieves the Password from the Data File. void PASS_IN() { fstream chew; chew.open( "CB_PASS.DAT", ios::in); chew>>pass; chew.close(); } // Stores the Password into the Data File. void PASS_OUT() { fstream blow; blow.open( "CB_PASS.DAT", ios::out | ios::binary | ios::trunc ); blow<<pass; blow.close(); }
  • 23. 6: [10] PROGRAM CODE // THE CLASS MNGR FUNCTIONS: void Mngr ::PW() { char Upass[10]; //user pass cout<<"n Please enter the new Password (10 char)n "; gets(Upass); cout<<"n Your Password has been Changed from”; cout<<“ " "<<pass<<" " to " "<<Upass<<" " .n"; strcpy(pass,Upass); } void Mngr ::Cview() { cout<<"n The Balance in your Account: "<<bal; cout<<endl; } void Mngr ::Cdep(unsigned long dep=-1) { if(dep==-1) //by manager { cout<<"n How much money to deposit into Account?n "; cin>>dw; cin.ignore(); bal+=dw; Cview(); } else { bal+=dep; } } void Mngr ::Cwid(unsigned long wid=-1) { if(wid==-1) //by manager { cout<<"n How much money to withdraw into Account?n "; cin>>dw; cin.ignore(); if( dw>bal ) { cout<<"n There is not enough money to withdraw."; } else {bal-=dw; } Cview(); } else { bal-=wid; } }
  • 24. 6: [11] PROGRAM CODE void Mngr::CCash() { int ch; char ok; cout<<"n Welcome to The Cube Cashier."; do { cout<<"n Choose Among The Options Below: nn 1. View Balancenn 2. Depositnn 3. Withdraw n "; cout<<"n Your Choice (1-3) :"; cin>>ch; cin.ignore(); cout<<endl; switch(ch) { case 1: Cview(); break; case 2: Cdep(); break; case 3: Cwid(); break; default: cout<<"n Invalid Option."; } cout<<"n Exit Cube Cashier? (Y/N) :"; cin.get(ok); cout<<endl; }while(ok=='n' || ok=='N'); }
  • 25. 6: [12] PROGRAM CODE // THE CLASS LIST FUNCTIONS: void LIST::view() { SORT_LIST(); Space(33,"_",'_'); Space(41,"THE LIST",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|nn"; for(int j=0; j<total; j++) { Space(12,cb[j].itmNo); Space(42,cb[j].Name); Space(7,cb[j].Age); Space(12,cb[j].Cost); cout<<"nn"; if((j+1)%10==0 && j!=0 && total>10) { cout<<" See the next 10 items? (Y/N) : "; char ch; cin.get(ch); cout<<endl; if(ch=='y' || ch=='Y') continue; else break; } } //End of for loop. //Exception Handling if(total==0) { Space(22,""); Space(52,"<<<< NO ITEMS FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); cout<<endl; getch(); cout<<endl; }
  • 26. 6: [13] PROGRAM CODE void LIST::viewHis() { char temp[100]; SORT_LIST(); Space(31,"_",'_'); Space(43,"THE HISTORY",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|nn"; for(int i=0; i<total; i++) { Space(12,cb[i].itmNo); Space(42,cb[i].Name); Space(7,cb[i].Age); Space(12,cb[i].Cost); cout<<"nn"; Space(12," | HISTORY: "); Space(57, cb[i].His ); cout<<endl; if( (i+1)!=total ) Space(74,"",'_'); cout<<"nn"; if( (i+1)%5==0 && i!=0 && total>5) { cout<<" See the next 5 items? (Y/N) : "; char ch; cin.get(ch); cout<<endl; if(ch=='y' || ch=='Y') { clrscr(); Space(31,"_",'_'); Space(43,"THE HISTORY",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|nn"; continue; } else break; } //end of outer if loop } //end of for loop
  • 27. 6: [14] PROGRAM CODE //Exception Handling if(total==0) { Space(22,""); Space(52,"<<<< NO ITEMS FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); cout<<endl; getch(); cout<<endl; } void LIST::SORT_LIST() { char tempIN[40]; char tempName[40]; int tempAge; unsigned long tempCost; char tempHis[100]; int i; int flag=0; for(i=total; i>0; i--) { for(int j=0; j<i-1; j++) { //To Compare the Strings. for(int o=0; o<strlen(cb[j].itmNo); o++) { if(cb[j].itmNo[o]==cb[j+1].itmNo[o]) continue; else if(cb[j].itmNo[o]>cb[j+1].itmNo[o]) { flag=1; break; } else {flag=0; break;} } //inner most for loop. if(flag==1) { strcpy(tempIN,cb[j].itmNo); strcpy(cb[j].itmNo,cb[j+1].itmNo); strcpy(cb[j+1].itmNo,tempIN); strcpy(tempName,cb[j].Name); strcpy(cb[j].Name,cb[j+1].Name); strcpy(cb[j+1].Name,tempName);
  • 28. 6: [15] PROGRAM CODE tempAge=cb[j].Age; cb[j].Age=cb[j+1].Age; cb[j+1].Age=tempAge; tempCost=cb[j].Cost; cb[j].Cost=cb[j+1].Cost; cb[j+1].Cost=tempCost; strcpy(tempHis,cb[j].His); strcpy(cb[j].His,cb[j+1].His); strcpy(cb[j+1].His,tempHis); } //END OF COMPARING STRING (IF STATEMENT) } //END OF INNER FOR LOOP } //END OF OUTER FOR LOOP } void LIST::Search() { int i; char S[40]; char Su[40]; char Sl[40]; Space(33,"_",'_'); Space(41,"THE SEARCH",'_'); cout<<endl; cout<<"n Which entity to search in?"; cout<<"nn 1. Namenn 2. Agenn 3. Costnn 4. Historynn Your Choice (1-4) : "; int ch; cin>>ch; switch(ch) { case 1: cout<<"n Enter a Word to Search for: "; gets(S); //to remove the case sensitivity of a search. for(i=0; i<strlen(S); i++) { Su[i]=toupper(S[i]); Sl[i]=tolower(S[i]); } cout<<"n"; Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|";
  • 29. 6: [16] PROGRAM CODE cout<<"nn"; int count=0; //counts no of letters in each word int J=0; //a memory location for temporary positions. int flag=0; // Outer loop searches moves from item to item nof LIST for(i=0; i<total; i++) { //Making Last character of every String/Name an End of Word character // i.e <space> if( cb[i].Name[ (strlen(cb[i].Name)-1) ] !=' ' ) cb[i].Name[ (strlen(cb[i].Name)) ]=' '; // Inner loop compares word by word of an item NAME at a time for(int j=0; j< strlen( cb[i].Name ) ; j++) { J=j-1; if(cb[i].Name[j]==' ') continue; do //Finds total length of the word. { J++; count++; } while(cb[i].Name[J+1] != ' '); //outermost if if(count==strlen(S)) { //if the lengths of searched item and word are same. if( (cb[i].Name[j]==Su[0]) || (cb[i].Name[j]==Sl[0]) ) { // if the first character of both searched item and name is same // Innermost loop compares character by character from // the starting of each word in the Item Name. for(int o=0; o<count; o++) { if(cb[i].Name[j+o]==Su[o] || cb[i].Name[j+o]==Sl[o]) { // if the character of the searched word and word in the Item Name is same if(o==count-1) // if this is the last character { flag=1; Space(12,cb[i].itmNo); Space(42,cb[i].Name); Space(7,cb[i].Age); Space(12,cb[i].Cost); cout<<"nn"; }//end of innermost if
  • 30. 6: [17] PROGRAM CODE } // end of if statement that checks first character of both words else {break; } //end of 3rd inner if-else }//end of innermost for loop }//end of inner if loop }//outermost if //moves the counter ( j )of the loop that searches word by word to the next //word of item Name. j+=(count-1); count=0; } //inner for loop. } //outer loop. //Exception Handling if(flag==0) { Space(22,""); Space(52,"<<<< NO SUCH ITEM FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break;
  • 31. 6: [18] PROGRAM CODE case 4: //The Search in the History of an item is the same //as the Search in the Name of the item cout<<"n Enter a Word to Search for: "; gets(S); //to remove the case sensitivity of a search. for(i=0; i<strlen(S); i++) { Su[i]=toupper(S[i]); Sl[i]=tolower(S[i]); } cout<<"n"; Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|"; cout<<"nn"; count=0; //counts no of letters in each word J=0; //a memory location for temporary positions. flag=0; for(i=0; i<total; i++) { if( cb[i].His[ (strlen(cb[i].His)-1) ] !=' ' ) cb[i].His[ (strlen(cb[i].His)) ]=' '; for(int j=0; j< strlen( cb[i].His ) ; j++) { J=j-1; if(cb[i].His[j]==' ') continue; //Finds total length of the word. do { J++; count++; } while(cb[i].His[J+1] != ' '); //outermost if if(count==strlen(S)) { //if the lengths of searched item and word is same. if( (cb[i].His[j]==Su[0]) || (cb[i].His[j]==Sl[0]) )
  • 32. 6: [19] PROGRAM CODE { for(int o=0; o<count; o++) { if(cb[i].His[j+o]==Su[o] || cb[i].His[j+o]==Sl[o]) { if(o==count-1) { flag=1; Space(12,cb[i].itmNo); Space(42,cb[i].Name); Space(7,cb[i].Age); Space(12,cb[i].Cost); cout<<"n"; Space(12," | "); Space(10, "History: "); cout<<"n"; Space(12," | "); Space(70, cb[i].His); cout<<"... "; cout<<"nnn"; } //end of 4th inner if } else { break; } }//end of innermost for loop }//end of if loop } //outermost if j+=(count-1); count=0; } //inner for loop. } //outer loop. if(flag==0) { Space(22,""); Space(52,"<<<< NO SUCH ITEM FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break;
  • 33. 6: [20] PROGRAM CODE case 2: //Search in Age of Item unsigned long U,L; //upper limit, lower limit flag=0; cout<<"n Enter the Upper Limit and Lower Limit. (Both Included in Search.)n"; cout<<"n ttt Lower Limit: "; cin>>L; cout<<" ttt Upper Limit: "; cin>>U; cout<<"nn ttt [ "<<L<<" <--> "<<U<<" ]"; cout<<endl; cout<<"n"; Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|"; cout<<"nn"; for(i=0; i<total; i++) { if( cb[i].Age >=L && cb[i].Age <=U ) { flag=1; Space(12,cb[i].itmNo); Space(42,cb[i].Name); Space(7,cb[i].Age); Space(12,cb[i].Cost); cout<<"nn"; } } //EXCEPTION HANDLING: if(flag==0) { Space(22,""); Space(52,"<<<< NO SUCH ITEM FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break;
  • 34. 6: [21] PROGRAM CODE case 3: //Search in Cost // It is the same as the search in age, //except for the fact that Cost is an unsigned long datatype, //and Age is an integer datatype flag=0; cout<<"n Enter the Upper Limit and Lower Limit. (Both Included in Search.)n"; cout<<"n ttt Lower Limit: "; cin>>L; cout<<" ttt Upper Limit: "; cin>>U; cout<<"nn ttt [ "<<L<<" <--> "<<U<<" ]"; cout<<endl; cout<<"n"; Space(30,"_",'_'); Space(44,"SEARCH RESULTS",'_'); cout<<endl; Space(12,"Item No | "); Space(42,"Name of Item"); Space(7,"| Age"); Space(12,"| Cost"); cout<<"|"; cout<<"nn"; for(i=0; i<total; i++) { if( cb[i].Cost >=L && cb[i].Cost <=U ) { flag=1; Space(12,cb[i].itmNo); Space(42,cb[i].Name); Space(7,cb[i].Age); Space(12,cb[i].Cost); cout<<"nn"; } } if(flag==0) { Space(22,""); Space(52,"<<<< NO SUCH ITEM FOUND! >>>>"); cout<<endl<<endl; } Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break; default: cout<<"Invalid Choice. "<<'n'; } //end of switch case } // End of Search()
  • 35. 6: [22] PROGRAM CODE int LIST::Find_it(char chk[40]) { int pos=-5; //String Comparism for(int i=0; i<total; i++) { if(chk[0]==cb[i].itmNo[0]) { for(int j=0; j<strlen(cb[i].itmNo); j++) { if(chk[j]==cb[i].itmNo[j]) { if(j==strlen(cb[i].itmNo)-1) pos=i; } else { break; } } } } return pos; } void LIST::Remove_it(char chk[40]) { int pos=Find_it(chk); //Deleting the items at position pos: for(int i=pos; i<total-1; i++) { strcpy(cb[i].itmNo,cb[i+1].itmNo); strcpy(cb[i].Name, cb[i+1].Name); cb[i].Age=cb[i+1].Age; cb[i].Cost=cb[i+1].Cost; } total--; }
  • 36. 6: [23] PROGRAM CODE void LIST::DEL() { char chk[40]; char ok='n'; do { cout<<" Enter the item number of the item you wish to delete.n "; gets(chk); int pos=Find_it(chk); if(pos==-5) //Error Handling { cout<<" No such Item Number. n You may have typed it Wrong."<<'n'; cout<<"nn Try again (y/n) ?n "; cin.get(ok); cin.ignore(); //Buffer error removed. cout<<"n"; } else { Remove_it(chk); cout<<"nn The Item has been deleted.nn"; ok='n'; } } while(ok=='y' || ok=='Y'); char ok2='n'; cout<<" Would you like to see THE LIST? (Y/N) n "; cin.get(ok2); if(ok2=='y' || ok2=='Y') { cout<<"nn"; view(); } }
  • 37. 6: [24] PROGRAM CODE void LIST::Buy() { char ok='n'; int pos[5]; int count=-1; char chk[5][40]; char bought='n'; do {count++; cout<<" Enter the item number of the item you wish to buyn "; gets(chk[count]); //Error Handling : You can not buy same item twice. int ok3=0; for(int i=0; i<count; i++) { if(strcmp(chk[count],chk[i])==0) ok3=1; } if(ok3==1) {cout<<"n You cannot buy the same item twice! nn"; count--; continue; } //END OF ERROR HANDLING. pos[count]=Find_it(chk[count]); //Error Handling: Wrong Item Number Entered. if(pos[count]==-5) { cout<<"n INVALID Item Number. Try Again. (y/n) n "; count--; ok='n'; } //To allow users to buy more than one item. max 5. else { bought='y'; cout<<"n Buy Another item? (y/n) [MAX: 5 items per Bill] n "; } cin.get(ok); cout<<endl; cin.ignore(); //Buffer error } while(ok=='y' || ok=='Y'); if(bought=='y') { Space(20,"_",'_'); Space(30,"BILL",'_'); cout<<endl; Space(40,"| Name");
  • 38. 6: [25] PROGRAM CODE Space(1 0,"| Cost"); cout<<endl; unsigned long totalcost=0; for(int i=0; i<=count; i++) { Space(40,cb[pos[i]].Name); Space(10,cb[pos[i]].Cost); totalcost+=cb[pos[i]].Cost; cout<<endl; } Space(20,"_",'_'); Space(30,"_",'_'); cout<<endl; Space(40," TOTAL: "); Space(10,totalcost); cout<<"nn Thank you for shopping at This Antique Store. n"; for(i=0; i<=count; i++) { Remove_it(cb[pos[i]].itmNo); } bal+=totalcost; //increasing store balance. } else { cout<<"n Hope you find something of interest next time."; } }
  • 39. 6: [26] PROGRAM CODE void LIST::EDIT() { char chk[40]; cout<<" Enter the Item No of the Item to Editn "; gets(chk); int pos=Find_it(chk); if(pos==-5) cout<<"n Invalid Item No."; else { char ok='n'; do { cout<<"n Which entity do you want to edit?"; cout<<"nn 1. Namenn 2. Agenn 3. Costnn 4. Historynn Your Choice (1-4) : "; int ch; cin>>ch; cin.ignore(); switch(ch) { case 1: cout<<"n Enter the new Name: "; char name[40]; gets(name); strcpy(cb[pos].Name,name); break; case 2: cout<<"n Enter the new Age: "; int age; cin>>age; cb[pos].Age=age; break; case 3: cout<<"n Enter the new Cost: "; unsigned long cost; cin>>cost; cb[pos].Cost=cost; break; case 4: cout<<"n Enter the new History:n "; char his[100]; gets(his); strcpy(cb[pos].His , his); break; default: cout<<" INVALID CHOICE. n"; } cin.ignore(); cout<<" nn Any more EDITs on this item? (Y/N) : "; cin.get(ok); } while(ok=='y' || ok=='Y'); cout<<" n Your EDITING has been successful! "; }
  • 40. 6: [27] PROGRAM CODE } // END OF EDIT() void LIST::ADD() { cout<<"n TO ADD AN ITEM TO THE STORE.nn 1. From Suppliernn 2. From Manager.nn "; cout<<"Your Choice (1-2) : "; int chk; cin>>chk; int i; switch(chk) { case 1: if( stotal > 0 ) { for(i=0; i<stotal; i++) { cout<<"n Item #"<<(i+1); cout<<"n Name of Item : "<<s[i].Name; cout<<"n Age of Item : "<<s[i].Age; cout<<"n Asked Price : "<<s[i].Cost; cout<<"n History : "<<s[i].His; cout<<"nn ACCEPT OR DECLINE? (A/D): "; char ch2; cin>>ch2; cout<<endl; if(ch2=='a' || ch2=='A') { for(int j=0; j<1; j++) { cout<<" Enter the Item No of new Item:n "; gets(cb[total].itmNo); //ERROR HANDLING. ITEM NO MUST BE UNIQUE. if(Find_it(cb[total].itmNo)!=-5) //if item number as such exists { cout<<" Entered Item Number Already Exists. RETRY! nn"; j--; continue; } //END OF ERROR HANDLING. } //END of inner FOR LOOP cout<<"n Enter the new Item's Price:n "; cin>>cb[total].Cost; m1.Cwid(s[i].Cost); //removing asked price by supplier from the store balance. strcpy( cb[total].Name,s[i].Name );
  • 41. 6: [28] PROGRAM CODE cb[total].Age=s[i].Age; strcpy( cb[total].His,s[i].His ); total++; } else if(ch2=='d' || ch2=='D') { cout<<" Item is Declined.n"; } if( (i+1) == stotal ) { cout<<"n No More Items By Supplier.n"; //clearing the CB_SALE.dat fstream f; f.open("CB_SALE.DAT", ios::out | ios::trunc ); f.close(); //end of clearing } } //end of for loop. //Deleting items from the Supplier Waiting List. stotal=0; } else { cout<<"n No Items by Supplier n"; } break; case 2: cout<<"n How many items to add? : "; int noi; cin>>noi; //no of items to sell cout<<endl; for(i=0; i<noi; i++) { cout<<"n Item To Add ("<<(i+1)<<"/"<<noi<<")nn"; cout<<" Enter the Item No of new Item : "; gets(cb[total].itmNo); //ERROR HANDLING. ITEM NO MUST BE UNIQUE. if(Find_it(cb[total].itmNo)!=-5) //if itm number as such exists {cout<<"n Entered Item Number Already Exists. RETRY! nn"; i--; continue; } //END OF ERROR HANDLING. cout<<"n Enter the Name of the Item : "; gets(cb[total].Name); cout<<"n Enter the Age of the Item : "; cin>>cb[total].Age; cout<<"n Enter the Item's Price : "; cin>>cb[total].Cost; cout<<"n Enter the Item's History : "; gets(cb[total].His); total++; }
  • 42. 6: [29] PROGRAM CODE break; default: cout<<"n Invalid Choice."; } //End of Switch Case char ok='n'; cin.ignore(); cout<<"n Would you like to see THE LIST? (Y/N) : "; cin.get(ok); cin.ignore(); if(ok=='y' || ok=='Y') { cout<<"nn"; view(); } } void LIST::Sell() { cout<<"n Welcome Supplier.n How many items to sell?n "; int noi; cin>>noi; //no of items to sell cout<<endl; for(int i=0; i<noi; i++) { cout<<"n Item To Sell No:"<<(i+1)<<"nn"; cout<<" Enter the Name of the Item: "; gets(s[stotal].Name); cout<<"n Enter the Age of the Item: "; cin>>s[stotal].Age; cout<<"n Enter your Selling Price: "; cin>>s[stotal].Cost; cout<<"n Enter Item's History: "; gets(s[stotal].His); stotal++; } cout<<"n Thank you for your offer. n"; }
  • 43. 6: [30] PROGRAM CODE // THE VOID MAIN FUNCTION: void main() { int ch; do { clrscr(); Space(74,"",'_'); cout<<endl; Space(33,"",'_'); Space(41,"MAIN MENU",'_'); cout<<endl; Space(25,"n 1. THE LIST"); Space(28," | Shows the List of items on Sale."); cout<<endl; Space(25,"n 2. THE HISTORY"); Space(28," | Learn more about an Item or Store"); cout<<endl; Space(25,"n 3. THE SEARCH "); Space(28," | Can't Find what you're looking for?",' '); cout<<endl; Space(25,"n 4. I AM A CUSTOMER"); Space(28," | Buy something nice for Yourself."); cout<<endl; Space(25,"n 5. I AM A SUPPLIER"); Space(28," | Sell us something We may like."); cout<<endl; Space(25,"n 6. I AM THE MANAGER"); Space(28," | A Password Protected Control Centre. "); cout<<endl; Space(25,"n 0. EXIT."); Space(28," | Done here? Leave the Online Store."); cout<<endl; Space(74,"",'_'); cout<<"nn Your Choice (0-6): "; cin>>ch; cin.ignore(); cout<<endl; clrscr(); switch(ch) { case 1: ob.view(); break; case 2: ob.viewHis(); break; case 3: ob.Search(); break;
  • 44. 6: [31] PROGRAM CODE case 4: cout<<endl; Space(30,"_",'_'); Space(44,"I AM A CUSTOMER",'_'); cout<<endl; cout<<endl; ob.Buy(); cout<<endl; Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break; case 5: cout<<endl; Space(30,"_",'_'); Space(44,"I AM A SUPPLIER",'_'); cout<<endl; cout<<endl; ob.Sell(); cout<<endl; Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break; case 6: int ch2; cout<<" Enter the Password: n "; char ps[10]; gets(ps); if(strcmp(ps,pass)==0) { cout<<"n Welcome Back Manager.nn"; do { clrscr(); cout<<endl; Space(29,"_",'_'); Space(45,"I AM THE MANAGER",'_'); cout<<endl; cout<<endl; Space(33,"n 1. CHANGE THE PASSWORD "); Space(20," | Be Safe & Secure. "); cout<<endl; Space(33,"n 2. ADD AN ITEM TO THE LIST "); Space(20," | More items to add? "); cout<<endl; Space(33,"n 3. EDIT AN ITEM ON THE LIST "); Space(20," | Make some Changes. ",' '); cout<<endl; Space(33,"n 4. DELETE AN ITEM FROM THE LIST");
  • 45. 6: [32] PROGRAM CODE Space(20," | Remove the Unwanted."); cout<<endl; Space(33,"n 5. USE THE CUBE CASHIER "); Space(20," | Check. Deposit. Withdraw."); cout<<endl; Space(33,"n 0. EXIT."); Space(20," | Done? Log out Safely."); cout<<endl; Space(74,"",'_'); cout<<"nn Your Choice (0-5): "; cin>>ch2; cin.ignore(); cout<<endl; clrscr(); cout<<endl; Space(29,"_",'_'); Space(45,"I AM THE MANAGER",'_'); cout<<endl; cout<<endl; switch(ch2) { case 1: m1.PW(); break; case 2: ob.ADD(); break; case 3: ob.EDIT(); cout<<endl; Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break; case 4: ob.DEL(); break; case 5: m1.CCash(); break; case 0: cout<<"n Thank you & Goodbye Manager! You Have been logged out Safely. n"; cout<<endl; Space(27,"_",'_'); Space(47,"[Enter To Continue]",'_'); getch(); break; default: cout<<"n INVALID CHOICE! RETRY! n"; } } while(ch2!=0);
  • 46. 6: [33] PROGRAM CODE } else { cout<<"n Wrong Password!n "; getch(); } break; default: cout<<"nn Thank you For Visitng & Come Again Soon! "; } }while(ch!=0); getch(); }
  • 47. 7: [1] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 1 _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Hitler's Globe 76 3800000 #23033 Karl's Ink Pen 125 6250000 #23058 Katana of Shogan Tokugawa 414 20700000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 #23081 Sword of Tipu Sultan 87 4350000 See the next 10 items? (Y/N) : Y #23091 The Pharaoh's Sceptre 124 6200000 #23096 Viking's Sledgehammer 168 8400000 ___________________________[Enter To Continue]____________________________
  • 48. 7: [2] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 2 _______________________________THE HISTORY________________________________ Item No | Name of Item | Age| Cost| #23022 Compass of Peter Tsar The Terrible 140 7000000 | HISTORY: The compass used by the famous conqueror __________________________________________________________________________ #23023 Gustave's Blueprints 120 6000000 | HISTORY: The original blueprints of the Eiffel Tower __________________________________________________________________________ #23032 Hitler's Globe 76 3800000 | HISTORY: The globe he used to strategize his conquests __________________________________________________________________________ #23033 Karl's Ink Pen 125 6250000 | HISTORY: He wrote the Communist Manifesto with this pen __________________________________________________________________________ #23058 Katana of Shogan Tokugawa 414 20700000 | HISTORY: The sword of the first Shogun of the Tokugawa clan __________________________________________________________________________ See the next 5 items? (Y/N) : Y _______________________________THE HISTORY________________________________ Item No | Name of Item | Age| Cost| #23059 Mahatma Gandhi's Spectacles 62 3100000 | HISTORY: See the world through the eyes of this reputed freedom fighter __________________________________________________________________________ #23067 Red Barron's Remains 96 4800000 | HISTORY: The famous fighter plane from World War 1 __________________________________________________________________________ #23076 Silver Claws Of Maharana 74 3700000 | HISTORY: The weapon he was most skilled in __________________________________________________________________________ #23077 Stallon's Lost Diary 76 3800000 | HISTORY: The journal where he wrote his strategies and plans __________________________________________________________________________ #23081 Sword of Tipu Sultan 87 4350000 | HISTORY: The sword he held before he met his death
  • 49. 7: [3] SAMPLE INPUT & OUTPUT __________________________________________________________________________ See the next 5 items? (Y/N) : Y _______________________________THE HISTORY________________________________ Item No | Name of Item | Age| Cost| #23091 The Pharaoh's Sceptre 124 6200000 | HISTORY: An Egyptian artefact that was a symbol of authority __________________________________________________________________________ #23096 Viking's Sledgehammer 168 8400000 | HISTORY: A weapon of great power used by the Vikings ___________________________[Enter To Continue]____________________________
  • 50. 7: [4] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 3 _________________________________THE SEARCH_______________________________ Which entity to search in? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 1 Enter a Word to Search for: gLoBe ______________________________SEARCH RESULTS______________________________ Item No | Name of Item | Age| Cost| #23032 Hitler's Globe 76 3800000 ___________________________[Enter To Continue]____________________________ _________________________________THE SEARCH_______________________________ Which entity to search in? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 3 Enter the Upper Limit and Lower Limit. (Both Included in Search.) Lower Limit: 0 Upper Limit: 1000000 [ 0 <--> 1000000 ] ______________________________SEARCH RESULTS______________________________ Item No | Name of Item | Age| Cost| <<<< NO SUCH ITEM FOUND! >>>> ___________________________[Enter To Continue]____________________________
  • 51. 7: [5] SAMPLE INPUT & OUTPUT _________________________________THE SEARCH_______________________________ Which entity to search in? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 2 Enter the Upper Limit and Lower Limit. (Both Included in Search.) Lower Limit: 100 Upper Limit: 200 [ 100 <--> 200 ] ______________________________SEARCH RESULTS______________________________ Item No | Name of Item | Age| Cost| #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23033 Karl's Ink Pen 125 6250000 #23091 The Pharaoh's Sceptre 124 6200000 #23096 Viking's Sledgehammer 168 8400000 ___________________________[Enter To Continue]____________________________ _________________________________THE SEARCH_______________________________ Which entity to search in? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 4 Enter a Word to Search for: fighter ______________________________SEARCH RESULTS______________________________ Item No | Name of Item | Age| Cost| #23059 Mahatma Gandhi's Spectacles 62 3100000 | History: | See the world through the eyes of this reputed freedom fighter ... #23067 Red Barron's Remains 96 4800000 | History: | The famous fighter plane from World War 1 ... ___________________________[Enter To Continue]____________________________
  • 52. 7: [6] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 4 ______________________________I AM A CUSTOMER_____________________________ Enter the item number of the item you wish to buy #23033 Buy Another item? (y/n) [MAX: 5 items per Bill] Y Enter the item number of the item you wish to buy #23081 Buy Another item? (y/n) [MAX: 5 items per Bill] N ____________________BILL__________________________ | Name | Cost Karl's Ink Pen 6250000 Sword of Tipu Sultan 4350000 __________________________________________________ TOTAL: 10600000 Thank you for shopping at This Antique Store. ___________________________[Enter To Continue]____________________________
  • 53. 7: [7] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 1 _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Hitler's Globe 76 3800000 #23058 Katana of Shogan Tokugawa 414 20700000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 #23091 The Pharaoh's Sceptre 124 6200000 #23096 Viking's Sledgehammer 168 8400000 ___________________________[Enter To Continue]____________________________
  • 54. 7: [8] SAMPLE INPUT & OUTPUT _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 5 ______________________________I AM A SUPPLIER_____________________________ Welcome Supplier. How many items to sell? 2 Item To Sell No:1 Enter the Name of the Item: The Orb of Galactus Enter the Age of the Item: 68 Enter your Selling Price: 5000000 Enter Item's History: The power of the cosmos trapped in an orb Item To Sell No:2 Enter the Name of the Item: The Toothpick of Gibralter Enter the Age of the Item: 45 Enter your Selling Price: 5600000 Enter Item's History: It still holds the piece of lettuce he pulled out Thank you for your offer. ___________________________[Enter To Continue]____________________________
  • 55. 7: [9] SAMPLE INPUT & OUTPUT __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 6 Enter the Password: Hamburger _____________________________I AM THE MANAGER_____________________________ 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 1 _____________________________I AM THE MANAGER_____________________________ Please enter the new Password (10 char) pass Your Password has been Changed from " Hamburger " to " pass " . ___________________________[Enter To Continue]____________________________
  • 56. 7: [10] SAMPLE INPUT & OUTPUT _____________________________I AM THE MANAGER_____________________________ 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 2 _____________________________I AM THE MANAGER_____________________________ TO ADD AN ITEM TO THE STORE. 1. From Supplier 2. From Manager. Your Choice (1-2) : 1 Item #1 Name of Item : The Orb of Galactus Age of Item : 68 Asked Price : 5000000 History : The power of the cosmos trapped in an orb ACCEPT OR DECLINE? (A/D): D Item is Declined. Item #2 Name of Item : The Toothpick of Gibralter Age of Item : 45 Asked Price : 5600000 History : It still holds the piece of lettuce he pulled out ACCEPT OR DECLINE? (A/D): A Enter the Item No of new Item: #23077 Entered Item Number Already Exists. RETRY! Enter the Item No of new Item: #23078 Enter the new Item's Price: 7000000 No More Items By Supplier. Would you like to see THE LIST? (Y/N) : Y
  • 57. 7: [11] SAMPLE INPUT & OUTPUT _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Hitler's Globe 76 3800000 #23058 Katana of Shogan Tokugawa 414 20700000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 #23078 The Toothpick of Gibralter 45 7000000 #23091 The Pharaoh's Sceptre 124 6200000 See the next 10 items? (Y/N) : N ___________________________[Enter To Continue]____________________________ _____________________________I AM THE MANAGER_____________________________ TO ADD AN ITEM TO THE STORE. 1. From Supplier 2. From Manager. Your Choice (1-2) : 2 How many items to add? : 2 Item To Add (1/2) Enter the Item No of new Item : #23001 Enter the Name of the Item : Boomerang of Alura Enter the Age of the Item : 89 Enter the Item's Price : 6900000 Enter the Item's History : Weapon used by Alura for hunt and battle Item To Add (2/2) Enter the Item No of new Item : #23004 Enter the Name of the Item : Book of Odis Enter the Age of the Item : 550 Enter the Item's Price : 8000000 Enter the Item's History : The book of spells according to Norse Mythology Would you like to see THE LIST? (Y/N) : Y
  • 58. 7: [12] SAMPLE INPUT & OUTPUT _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23001 Boomerang of Alura 89 6900000 #23004 Book of Odis 550 8000000 #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Hitler's Globe 76 3800000 #23058 Katana of Shogan Tokugawa 414 20700000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 See the next 10 items? (Y/N) : Y #23078 The Toothpick of Gibralter 45 7000000 #23091 The Pharaoh's Sceptre 124 6200000 #23096 Viking's Sledgehammer 168 8400000 ___________________________[Enter To Continue]____________________________
  • 59. 7: [13] SAMPLE INPUT & OUTPUT _____________________________I AM THE MANAGER_____________________________ 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 3 _____________________________I AM THE MANAGER_____________________________ Enter the Item No of the Item to Edit #23032 Which entity do you want to edit? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 1 Enter the new Name: Globe of Adolf Hitler Any more EDITs on this item? (Y/N) : Y Which entity do you want to edit? 1. Name 2. Age 3. Cost 4. History Your Choice (1-4) : 2 Enter the new Age: 81 Any more EDITs on this item? (Y/N) : N Your EDITING has been successful! Would you like to see THE LIST? (Y/N) Y
  • 60. 7: [14] SAMPLE INPUT & OUTPUT _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23001 Boomerang of Alura 89 6900000 #23004 Book of Odis 550 8000000 #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Globe of Adolf Hitler 81 3800000 #23058 Katana of Shogan Tokugawa 414 20700000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 See the next 10 items? (Y/N) : N ___________________________[Enter To Continue]____________________________ _____________________________I AM THE MANAGER_____________________________
  • 61. 7: [15] SAMPLE INPUT & OUTPUT 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 4 _____________________________I AM THE MANAGER_____________________________ Enter the item number of the item you wish to delete. #23058 The Item has been deleted. Would you like to see THE LIST? (Y/N) Y _________________________________THE LIST_________________________________ Item No | Name of Item | Age| Cost| #23001 Boomerang of Alura 89 6900000 #23004 Book of Odis 550 8000000 #23022 Compass of Peter Tsar The Terrible 140 7000000 #23023 Gustave's Blueprints 120 6000000 #23032 Globe of Adolf Hitler 81 3800000 #23059 Mahatma Gandhi's Spectacles 62 3100000 #23067 Red Barron's Remains 96 4800000 #23076 Silver Claws Of Maharana 74 3700000 #23077 Stallon's Lost Diary 76 3800000 #23078 The Toothpick of Gibralter 45 7000000 See the next 10 items? (Y/N) : Y #23091 The Pharaoh's Sceptre 124 6200000 #23096 Viking's Sledgehammer 168 8400000 ___________________________[Enter To Continue]____________________________
  • 62. 7: [16] SAMPLE INPUT & OUTPUT _____________________________I AM THE MANAGER_____________________________ 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 5 _____________________________I AM THE MANAGER_____________________________ Welcome to The Cube Cashier. Choose Among The Options Below: 1. View Balance 2. Deposit 3. Withdraw Your Choice (1-3) :1 The Balance in your Account: 2437783003 Exit Cube Cashier? (Y/N) :N Choose Among The Options Below: 1. View Balance 2. Deposit 3. Withdraw Your Choice (1-3) :3 How much money to withdraw from Account? 7783003 The Balance in your Account: 2430000000 Exit Cube Cashier? (Y/N) : Y
  • 63. 7: [17] SAMPLE INPUT & OUTPUT _____________________________I AM THE MANAGER_____________________________ 1. CHANGE THE PASSWORD | Be Safe & Secure. 2. ADD AN ITEM TO THE LIST | More items to add? 3. EDIT AN ITEM ON THE LIST | Make some Changes. 4. DELETE AN ITEM FROM THE LIST | Remove the Unwanted. 5. USE THE CUBE CASHIER | Check. Deposit. Withdraw. 0. EXIT. | Done? Log out Safely. __________________________________________________________________________ Your Choice (0-5): 0 _____________________________I AM THE MANAGER_____________________________ Thank you & Goodbye Manager! You Have been logged out Safely. ___________________________[Enter To Continue]____________________________ __________________________________________________________________________ _________________________________MAIN MENU________________________________ 1. THE LIST | Shows the List of items on Sale. 2. THE HISTORY | Learn more about an Item or Store 3. THE SEARCH | Can't Find what you're looking for? 4. I AM A CUSTOMER | Buy something nice for Yourself. 5. I AM A SUPPLIER | Sell us something We may like. 6. I AM THE MANAGER | A Password Protected Control Centre. 0. EXIT. | Done here? Leave the Online Store. __________________________________________________________________________ Your Choice (0-6): 0 Thank you For Visiting & Come Again Soon!
  • 64. 8: [1] BIBLIOGRAPHY COMPUTER SCIENCE WITH C++ SUMITA ARORA1 2 3 HTTP://CPLUSPLUS.COM HTTP://TDOCPP.CO.CC
  • 65. 9: [1] There are a number of possibilities to make this software better. After learning the usage and application of graphics, I plan on further improving the interactive nature of the software. The menu would have clickable buttons rather than typed in choices and by introducing the mouse pointer, selection of those options would be far more convenient. I also intend on introducing selective functionality through user accounts. This would provide more options for suppliers and managers. A Supplier can make an account, send an offer and be updated on the manager’s decision as well. This would be possible only with user accounts where the supplier can be identified by their username. Also, if the store is run by more than one person and each person is assigned a specific task to play, user accounts will be able to divide the manager options accordingly. As of now, its functions are restricted to those of an Antique Store. I plan to generalize it so that it can be used in any type of store allowing the manager to choose which fields and options are most suitable for his store. The next thing would be to encrypt the data files. Presently, the files store the details of the items on sale, the balance of the store and the password to access the manager options. These can be easily accessed using a notepad in windows. To prevent this, the files should be encrypted so that those who do try to read the data will not be able to make sense of it, and making the files Read Only can prevent offenders from changing the information. Unfortunately, this software is mainly just recording changes in the store with transactions. With much further study, I can implement it in the real world. Rather than recording the money moving from one account to another, the software can be made to access the bank accounts and allow the transaction of actual money. SCOPE FOR FUTURE EXPANSION
  • 66. NEIL MATHEW XII B 13 DON BOSCO SCHOOL