Professional Documents
Culture Documents
Shoping Mall in C
Shoping Mall in C
CSE202
TOPIC:SHOPING MALL
I take this opportunity to present my votes of thanks to all those guidepost who
really acted as lightening pillars to enlighten our way throughout this project that
has led to successful and satisfactory completion of this study.
C++:
As one of the most popular programming languages ever created, C++ is widely used in the
software industry. Some of its application domains include systems software, application
software, device drivers, embedded software, high-performance server and client applications,
and entertainment software such as video games. Several groups provide both free and
proprietary C++ compiler software, including the GNU Project, Microsoft, Intel and Borland.
C++ has greatly influenced many other popular programming languages, most
notably C# and Java.
C++ is also used for hardware design, where design is initially described in C++, then analyzed,
architecturally constrained, and scheduled to create a register transfer level hardware
description language via high-level synthesis.
The language began as enhancements to C, first adding classes, then virtual functions, operator
overloading, multiple inheritance, templates, and exception handling among other features.
After years of development, the C++ programming language standard was ratified in 1998
asISO/IEC 14882:1998. That standard is still current, but is amended by the 2003
technical corrigendum, ISO/IEC 14882:2003. The next standard version is in development.
SHOPING MALL:
A shopping mall, shopping centre or shopping precinct is one or more buildings forming a
complex of shops representing merchandisers, with interconnecting walkways enabling visitors
to easily walk from unit to unit, along with a parking area – a modern, indoor version of the
traditional marketplace.
Modern "car-friendly" strip malls developed from the 1920s, and shopping malls corresponded
with the rise of suburban living in many parts of the Western World, especially the United
States, after World War II. From early on, the design tended to be inward-facing, with malls
following theories of how customers could best be enticed in a controlled environment. Similar,
the concept of a mall having one or more "anchor" or "big box" stores was pioneered early, with
individual stores or smaller-scale chain stores intended to benefit from the shoppers attracted by
the big stores.
SOURCE CODE
//**********************************************************
// PROJECT SHOPPING MALL
//**********************************************************
//**********************************************************
// INCLUDED HEADER FILES
//**********************************************************
#include <iostream.h>
#include <fstream.h>
#include <process.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
//**********************************************************
// THIS CLASS CONTROL ALL THE FUNCTIONS IN THE MENU
//**********************************************************
class MENU
{
public :
void main_menu(void) ;
void introduction(void) ;
private :
void edit_menu(void) ;
void edit_item(void) ;
void edit_shop(void) ;
};
//**********************************************************
// THIS CLASS CONTAINS FUNCTIONS RELATED TO BOOKS
//**********************************************************
class ITEM
{
public :
void list(void) ;
char *itemname(int) ;
protected :
void add_new_item(int, char tname[33], char tbrand[26], float) ;
void deletion(void) ;
int item_found(int) ;
int itemname_found(char []) ;
int recordno(int) ;
char *brandname(int) ;
float itemprice(int) ;
int itemcodeof(char[]) ;
void display(int) ;
int reccount(void) ;
void delete_rec(int) ;
private :
int itemcode ;
char name[33], brand[26] ;
float price ;
};
//**********************************************************
// THIS CLASS CONTAINS FUNCTIONS RELATED TO MEMBERS
//**********************************************************
class SHOP
{
public :
void list(void) ;
protected :
void add_shop(int, int, char [], char [], char[]) ;
int shop_found(int) ;
char *shopname(int) ;
char *shopphone(int) ;
char *shopaddress(int) ;
int recordno(int) ;
void display(int) ;
void delete_rec(int) ;
private :
int shopcode, itemcode ;
char name[26], phone[10], address[33] ;
};
//**********************************************************
// THIS IS DERIVED FROM CLASS BOOK & MEMBER AND CONTAINS
// FUNCTIONS FOR WORKING
//**********************************************************
class WORKING : public ITEM, public SHOP
{
public :
void add_item(void) ;
void add_shop(void) ;
void delete_item(void) ;
void delete_shop(void) ;
};
//**********************************************************
// FUNCTION TO DISPLAY MAIN MENU & CONTROL ALL THE FUNCTION
// IN THE MAIN MENU.
//**********************************************************
void MENU :: main_menu(void)
{
char ch ;
while (1)
{
clrscr() ;
gotoxy(29,6) ;
cout <<"S H O P P I N G M A L L" ;
gotoxy(29,7) ;
cout <<"~~~~~~~~~~~~~~~~~~~~~~~~~~" ;
gotoxy(30,10) ;
cout <<"1. INTRODUCTION" ;
gotoxy(30,11) ;
cout <<"2. ADD NEW ITEM" ;
gotoxy(30,12) ;
cout <<"3. ADD NEW SHOP" ;
gotoxy(30,13) ;
cout <<"4. LIST OF ITEMS" ;
gotoxy(30,14) ;
cout <<"5. LIST OF SHOPS" ;
gotoxy(30,15) ;
cout <<"6. EDIT" ;
gotoxy(30,16) ;
cout <<"0. QUIT" ;
gotoxy(30,20) ;
cout <<"Enter your choice : " ;
ch = getche() ;
if (ch == 27)
break ;
else
if (ch == '1')
introduction() ;
else
if (ch == '2')
{
WORKING W ;
W.add_item() ;
}
else
if (ch == '3')
{
WORKING W ;
W.add_shop() ;
}
else
if (ch == '4')
{
ITEM I;
I.list() ;
}
else
if (ch == '5')
{
SHOP S ;
S.list() ;
}
else
if (ch == '6')
edit_menu() ;
else
if (ch == '0')
break ;
}
}
//**********************************************************
// FUNCTION TO DISPLAY EDIT MENU
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURN 0 IF GIVEN BOOK NAME NOT FOUND
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURN RECORD NO. FOR THE BOOK CODE
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURNS THE AUTHOR NAME OF THE GIVEN BOOK
// CODE.
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURNS THE BOOK PRICE OF THE GIVEN BOOK
// CODE.
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURNS THE BOOK CODE OF THE GIVEN BOOK
// NAME.
//**********************************************************
//**********************************************************
// THIS FUNCTION ADD THE RECORD IN THE BOOK FILE
//**********************************************************
void ITEM :: add_new_item(int tcode,char tname[33], char tbrand[26], float tprice)
{
fstream file ;
file.open("ITEM.DAT", ios::app) ;
itemcode = tcode ;
strcpy(name,tname) ;
strcpy(brand,tbrand) ;
price = tprice ;
file.write((char *) this, sizeof(ITEM)) ;
file.close() ;
}
//**********************************************************
// THIS FUNCTION DISPLAY THE RECORD FROM THE BOOK FILE
// FOR THE GIVEN BOOK CODE
//**********************************************************
}
file.close() ;
}
//**********************************************************
// THIS FUNCTION DISPLAY THE LIST OF BOOKS.
//**********************************************************
//**********************************************************
// THIS FUNCTION RETURNS MEMBER ADDRESS OF THE GIVEN MEMBER
// CODE.
//**********************************************************
if (ch == 'Y')
{
add_new_item(tcode,tname,tbrand,tprice) ;
}
do
{
gotoxy(5,17) ; clreol() ;
cout <<"Do you want to add more (y/n) : " ;
ch = getche() ;
ch = toupper(ch) ;
} while (ch != 'Y' && ch != 'N') ;
} while (ch == 'Y') ;
}
//**********************************************************
// THIS FUNCTION GIVES DATA TO ADD RECORD IN THE MEMBER FILE
//**********************************************************
Shoping mall is a one type of application software that we can enter any item and its respective price,
quantity etc. This application is beneficial for me that we can learn so many new things it is beneficial
for shop.
REFERENCE :
WORLD.COM
GOOGLE.COM