78% found this document useful (18 votes)
8K views

Class 12th General Store C++ Project

The document is a C++ program for a general store simulation. It includes functions for displaying a shopping menu, adding items to a cart, checking out, and viewing employee profiles. The main function displays a welcome message and smiley face, then allows the user to enter the shopping area, view employees, or exit. Selection leads to calling the appropriate functions like shop() to display products and cart() to show a cart icon.

Uploaded by

DeveshMagotra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
78% found this document useful (18 votes)
8K views

Class 12th General Store C++ Project

The document is a C++ program for a general store simulation. It includes functions for displaying a shopping menu, adding items to a cart, checking out, and viewing employee profiles. The main function displays a welcome message and smiley face, then allows the user to enter the shopping area, view employees, or exit. Selection leads to calling the appropriate functions like shop() to display products and cart() to show a cart icon.

Uploaded by

DeveshMagotra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 31

C++

Project
File

Submitted By :Devesh Magotra


XII-B
15
Submitted To :Mrs. Neenu

ACKNOWLEDGEMENT
I would like to convey my sincere gratitude to my
Teacher
Mrs. Neenu for letting me do this
project.

I would like to Thank by Elder Brother for Helping Me in


the Project. And Special Thanks To Mrs. Neenu for Guiding
And Instructing Us Throughout The Project. I would also like
to Thank Mrs. Mamta For All Her Help.

Last but not the least; I would like to thank all my friends
for helping me with this project.

/
*///////////////////////////////////////////////////////////////////////////
/
/
/
/
/
/
SINGHAM GENERAL STORE
/
/
/
/
/
/
/
//////////////////////////////////////////////////////////////////////////*/
#include<fstream.h>
#include<conio.h>
#include<string.h>
#include<process.h>
ofstream obj("f9.txt");
class project
{
public:
int a,amount1,price,p,q,amount,x,y;
float c,b;
char s,z,pass[30];
void employee();
void shop();
void smiley(int,int,int,int);
void cart(int,int,int,int);

void jatin();
void devesh();
void singham();
}pro;
void main()
{
clrscr();
int i,j,k,l,a;
char name[20];
cout<<"\t"<<" \n\n\n\n\n\n\n \t\t\tWelcome To
Singham General Store \n \n \n";
cout<<"\t\t\t We Welcome You With A Smile
\n \n \n";
pro.smiley(i,j,k,l);
cout<<" \n \n Enter Your Name :- ";
cin.get(name,30);
obj<<"\n\n\t\t\tSINGHAM GENERAL
STORE\n\t\t\t";
for(i=0;i<=20;++i)
obj<<"_";
obj<<"\n\n\t\t\t CUSTOMER LOG\n\t\t\t ";
for(i=0;i<=15;++i)
obj<<"_";
obj<<"\n\n\n The Customers name was :"<<name;
cout<<" \n\n 1.Enter The Shopping Mall ";
cout<<" \n\n 2.Employee Database Check ";
cout<<" \n\n 3.Exit ";

cout<<" \n\n Enter your choice :- ";


cin>>a;
clrscr();
if(a==1)
{obj<<" \n\n The customer chose to enter the
shopping mall.";
pro.shop();
}
else if(a==2)
{
obj<<"\n\n The customer chose to view the
employee information.";
pro.employee();
}
else
{
cout<<"\n\n The customer chose to exit
immediately.";
exit(0);
}
getch();
ifstream fi("f9.txt",ios::app);
fi>>name;
fi>>a;
obj.close();
fi.close();
}
void project::shop()

{
int i,j,k,l;
cout<<"\n\n\n";
cout<<" Item No. \t \t Item Name \t \t\tPrice
Item \n \n ";
cout<<" \n\n 1. \t \t Lays Masala Magic Chips
100g \t \t Rs 20/-";
cout<<" \n\n 2. \t \t Coca Cola Coldrink 2 ltrs\t\t
Rs 60/-";
cout<<" \n\n 3. \t \t Khaata Meetha Namkeen
105g \t \t Rs 25/- ";
cout<<" \n\n 4. \t \t Sunfeast Cream Biscuit 75g
\t \t Rs 15/- ";
cout<<" \n\n 5. \t \t Aashirwaad Atta 1Kg\t
\t \t
Rs 175/-";
cout<<" \n\n 6. \t \t Amul Butter 1Kg\t \t \t Rs
120/-";
cout<<" \n \n \n \n Now Lets Proceed With
Billing :- \n \n";
cout<<" Choose The Item No. , Quantity And
Proceed To Check out \n \n";
cout<<" Item No. \t \t \t \t Quantity \n \n ";
cin>>pro.x;
cout<<"\t \t \t \t \t ";
cin>>pro.y;
cout<<"\t \t \t \t \t \n \n";
cout<<" Do You Wanna Buy SomeThing Else
(y/n) :-";

cin>>pro.z;
if(pro.z=='y')
{
cout<<" \n \n \n \n \n \n \n Item No. \t \t \t \t
Quantity \n \n ";
cin>>pro.p;
cout<<"\t \t \t \t \t ";
cin>>pro.q;
}
if(pro.z=='n')
{
cout<<" \n \n \n \n OK . Now Lets Proceed To
Check out";
pro.amount1=0;
}
clrscr();
for(l=0;l<=79;++l)
cout<<"_";
cout<<"\n";
cout<<"\t\t\t"<<" SINGHAM GENERAL
STORE"<<endl;
for(l=0;l<=79;++l)
cout<<"_";
cout<<"\n\n";
cout<<" Product Name \t \t \t\tAmount\n";
if(pro.x==1)
{
pro.price=20;

pro.amount=pro.price*pro.y;
cout<<" \n \n Lays Masala Magic Chips 100g";
obj<<" \n\n The customer bought "<<pro.y<<"
Lays Masala Magic Chips 100g.";
cout<<"\t \t \t "<<amount<<"/-";
}
if(pro.x==2)
{
pro.price=60;
pro.amount=pro.price*pro.y;
cout<<" \n \n Coca Cola Cold Drink 2 ltrs";
obj<<" \n\n The customer bought "<<pro.y<<"
Coca Cola Cold Drink 2 ltrs.";
cout<<"\t\t\t "<<pro.amount<<"/-";
}
if(x==3)
{
price=25;
pro.amount=price*pro.y;
cout<<" \n \n Khatta Meetha Namkeen 105g";
obj<<" \n\n The customer bought "<<pro.y<<"
Khatta Meetha Namkeen 105g.";
cout<<"\t \t \t "<<pro.amount<<"/-";
}
if(x==4)
{
price=12;
pro.amount=price*pro.y;

cout<<" \n \n Sunfeast Cream Biscuit 75g";


obj<<" \n\n The customer bought "<<pro.y<<"
Sunfeast Cream Biscuit 75g.";
cout<<"\t \t \t "<<pro.amount<<"/-";
}
if(x==5)
{
price=175;
pro.amount=price*pro.y;
cout<<" \n \n Aashirwaad Aata 1Kg";
obj<<" \n\n The customer bought "<<pro.y<<"
Aashirwaad Aata 1Kg.";
cout<<"\t \t \t \t "<<pro.amount<<"/-";
}
if(x==6)
{
price=120;
pro.amount=price*pro.y;
cout<<" \n \n Amul Butter 1Kg";
obj<<" \n\n The customer bought "<<pro.y<<"
Amul Butter 1Kg.";
cout<<"\t \t \t \t "<<pro.amount<<"/-";
}
if(p==1)
{
price=20;
pro.amount1=price*q;
cout<<"\n \n Lays Masala Magic Chips 100g";

obj<<" \n\n The also customer bought


"<<pro.y<<" Lays Masala Magic Chips 100g.";
cout<<"\t \t "<<pro.amount1<<"/-";
}
if(p==2)
{
price=60;
pro.amount1=price*q;
cout<<" \n \n Coca Cola Cold Drink 2 ltrs ";
obj<<" \n\n The also customer bought
"<<pro.y<<" Coca Cola Cold Drink 2 ltrs.";
cout<<"\t\t\t "<<pro.amount1<<"/-";
}
if(p==3)
{
price=25;
pro.amount1=price*q;
cout<<" \n \n Khatta Meetha Namkeen 105g";
obj<<" \n\n The also customer bought
"<<pro.y<<" Khatta Meetha Namkeen 105g.";
cout<<"\t \t \t "<<pro.amount1<<"/-";
}
if(p==4)
{
price=12;
pro.amount1=price*q;
cout<<" \n \n Sunfeast Cream Biscuit 75g";

obj<<" \n\n The also customer bought


"<<pro.y<<" Sunfeast Cream Biscuit 75g.";
cout<<"\t \t \t "<<pro.amount1<<"/-";
}
if(p==5)
{
price=175;
pro.amount1=price*q;
cout<<" \n \n Aashirwaad Aata 1Kg";
obj<<" \n\n The also customer bought
"<<pro.y<<" Aashirwaad Aata 1Kg.";
cout<<"\t \t \t \t "<<pro.amount1<<"/-";
}
if(p==6)
{
price=120;
pro.amount1=price*q;
cout<<" \n \n Amul Butter 1Kg";
obj<<" \n\n The also customer bought
"<<pro.y<<" Amul Butter 1Kg.";
cout<<"\t \t \t \t "<<pro.amount1<<"/-";
}
cout<<"\n\n";
pro.cart(i,j,k,l);
cout<<"\n Do You Have Any Discount Voucher ?(
Say y/n) :- ";
cin>>pro.s;
if(pro.s=='y')

{
obj<<"\n\n The customer had the discount
voucher.";
cout<<"\n Enter Coupon Code : ";
cin>>pro.pass;
if(stricmp(pro.pass,"NEENU"))
//stricmp
used.
cout<<" \n Sorry , Incorrect Coupon
Code. !!! \n";
else{cout<<" \n Coupon Code Accepted. You
Got 20% Discount \n ";
cout<<" \n You Have Saved 12.5 %
VAT";
if(pro.z=='y')
pro.c=0.2*(pro.amount+pro.amount1);
else
pro.c=0.2*(pro.amount);
}
}
cout<<" \n \n Bill To Be Paid :Rs."<<(pro.amount+pro.amount1)-pro.c<<"/-";
obj<<"\n\n The customer paid :Rs."<<(pro.amount+pro.amount1)-pro.c<<"/-";
cout<<" \n \n Thanks To Neenu Mam For Helping
Us Alot ";
cout<<" \n \n Made By :- Jatin Shukla & Devesh
Magotra\n";
for(l=0;l<=79;++l)
cout<<"_";

cout<<"\n";
for(l=0;l<=79;++l)
cout<<"_";
getch();
}
void project::employee()
{
clrscr();
char f[20];
int c;
cout<<"\n\n Enter PPN Password To Acess The
Database :- ";
cin>>f;
if(stricmp(f,"india"))
//stricmp used.
{
obj<<"\n\n The customer entered
incorrect PPN password.";
cout<<" \n Sorry , Incorrect
Password. !!! \n";
} else
{
obj<<"\n\n The customer entered correct PPN
password.";
cout<<" \n \n Password Accepted ";
cout<<"\n\n Which employees information would
you like to view :- ";

cout<<"\n\n 1.Jatin Shukla\n\n 2.Devesh


Magotra\n\n 3.Bajirao Singham";
cout<<" \n\n Enter Your Choice :- ";
cin>>c;
switch(c)
{
case 1:obj<<"\n\n The customer chose to view the
information of Jatin Shukla.";
jatin();
break;
case 2:obj<<"\n\n The customer chose to view the
information of Devesh Magotra.";
devesh();
break;
case 3:obj<<"\n\n The customer chose to view the
information of Bajirao Singham.";
singham();
break;
default:exit(0);
}
}
}
void project::jatin()
{
cout<<"\n\n Name
|- Jatin Shukla";
cout<<"\n\n Employee ID |- 110000";
cout<<"\n\n Age
|- 28 Years";
cout<<"\n\n Position
|- Senior Executive";

cout<<"\n\n Experience |- 5 Years";


cout<<"\n\n Qualification |- Post Graduate";
cout<<"\n\n Salary
|- Rs 40000/-";
}
void project::devesh()
{
cout<<"\n\n Name
|- Devesh Magotra";
cout<<"\n\n Employee ID |- 114422";
cout<<"\n\n Age
|- 28 Years";
cout<<"\n\n Position
|- Senior Executive";
cout<<"\n\n Experience |- 5 Years";
cout<<"\n\n Qualification |- Post Graduate";
cout<<"\n\n Salary
|- Rs 40000/-";
}
void project::singham()
{
cout<<"\n\n Name
|- Bajirao Singham";
cout<<"\n\n Employee ID |- 114433";
cout<<"\n\n Age
|- 12 Years";
cout<<"\n\n Position
|- Junior Sweeper";
cout<<"\n\n Experience |- 1 Day";
cout<<"\n\n Qualification |- Post Graduate in
Sweeping";
cout<<"\n\n Salary
|- Rs 5.75/-";
}
void project::smiley(int i,int j,int k,int l)
{
cout<<"\t\t\t\t";

for(k=0;k<=8;++k)
cout<<"*";
cout<<"\n";
for(i=0;i<=2;++i)
//for loop used
{
for(j=0;j<=50;++j)
{
if((j==31)||(j==40))
//if statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=0;++i)
//for loop used
{
for(j=0;j<=50;++j)
{
if((j==31)||(j==33)||(j==36)||(j==38))
//if
statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}

for(i=0;i<=2;++i)
//for loop used
{
for(j=0;j<=50;++j)
{
if((j==31)||(j==40))
//if statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=0;++i)
//for loop used
{
for(j=0;j<=50;++j)
{
if((j==31)||(j==32)||(j==37)||(j==38))
//if
statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=0;++i)
//for loop used
{
for(j=0;j<=50;++j)

{
if((j==31)||(j==33)||(j==34)||(j==35)||(j==37))
//if statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=2;++i)
//for loop used
{
for(j=0;j<=50;++j)
{
if((j==31)||(j==40))
//if statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
cout<<"\t\t\t\t";
for(l=0;l<=8;++l)
cout<<"*";
}
void project::cart(int i,int j,int k,int l)

{
cout<<"\t\t\t";
for(k=0;k<=4;++k)
cout<<"*";
cout<<"\n";
for(i=0;i<=2;++i)
//for loop used
{
for(j=0;j<=55;++j)
{
if(j==26+i)
//if statement used
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
cout<<" \t\t\t ";
for(k=0;k<=13;++k)
cout<<"*";
cout<<"\n";
for(i=0;i<=3;++i)
{
for(j=0;j<=55;++j)
{
if((j==28)||(j==40))
{
cout<<"*";

}
cout<<" ";
}
cout<<"\n";
}
cout<<" \t\t\t ";
for(l=0;l<=13;++l)
cout<<"*";
cout<<"\n";
for(i=0;i<=6;++i)
{
for(j=0;j<=55;++j)
{
if((j==31+i)||(j==37-i))
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=0;++i)
{
for(j=0;j<=55;++j)
{
if((j==30)||(j==31)||(j==35)||(j==36))
{
cout<<"*";

}
cout<<" ";
}
cout<<"\n";
}
for(i=0;i<=0;++i)
{
for(j=0;j<=55;++j)
{
if((j==31)||(j==37))
{
cout<<"*";
}
cout<<" ";
}
cout<<"\n";
}
}

REMARKS

You might also like