Sie sind auf Seite 1von 5

// salimullah project.cpp : Defines the entry point for the console application.

//project for shop to calculate profit sum per day//


//sum per month etc//
//***saleemullah***//
//***2015***//
#include "stdafx.h"
#include"iostream"
#include"conio.h"
using namespace std;
void calculator();
void main()
{
cout<<endl;
cout<<"***project for shop management system***"<<endl;
cout<<"***in this project we calculate***"<<endl;
cout<<"***sum of price of product for customer***"<<endl;
cout<<"***sum of real_price of product***"<<endl;
cout<<"***profit per-day***"<<endl;
cout<<"***profit per mounth***"<<endl;
cout<<"-----------------------------------------------------------------------------"<<endl;
cout<<endl;
ass:
pas:
cout<<"\n\n\n***wellcome***\n\n\n";
cout<<"enter pasword\n\n";
int pas=1234;
int tt;
cin>>tt;
if(tt!=pas)
{
cout<<"\ayou enter wrong pasword try again\n\n";
goto pas;
}
else
{
cout<<"----------------------------SYSTEM CONTINUE------------------------\n\n";
cout<<"-------------------------------------------------------------------"<<endl;
int sump=0,sum_realp=0,day,i,n,m,iprofit;
//sum_realp is the amount which is real amount per month means the amount of the
thing which he get//
//sump show sum per month//
for(i=0;i<=31;i++)
{
int sum=0,sum_real=0;
//sum show sum per day for customer//
//sum_real show sum per day for real amount//
for(int k=0;k<=1200;k++)
{

cout<<"enter amount of product for customer\n"<<endl;


cin>>n;
if(n==0)
break;
cout<<"enter real amount of product"<<endl<<endl;
cin>>m;
sum=sum+n;
sump=sump+n;
cout<<"sum of product for customer rate per day="<<sum<<endl;
sum_real=sum_real+m;
sum_realp=sum_realp+m;
cout<<"\n\nsum of product for customer rate whole mounth="<<sump<<endl<<
endl;
cout<<"sum of product for real-amount per day="<<sum_real<<endl<<endl;
cout<<"sum for all real of whole mounth="<<sum_realp<<endl;
int profit;
//profit show the profit of per day//
profit=sum-sum_real;
iprofit=sump-sum_realp;
//iprofit show the profit for whole mounth//
cout<<"\n\nprofit of per day="<<profit<<endl<<endl;
cout<<"all profit for whole mounth="<<iprofit<<endl<<endl;
}
cout<<"\nenter day"<<endl;
cin>>day;
if(day==0)
break;
}
int r;
go:
cout<<"\nif you want to see your total profit then\n\n";
cout<<"then enter your passwords choice 1 for yes or 2 for no\n";
cout<<"\n3 for enter data again\n"<<endl<<endl;
cin>>r;
switch(r)
{
case 1:
{
int p;
passs:
cout<<"\nenter your pasword to find profit\n\n";
cin>>p;
if(p==1234)
{
int ko;
cout<<"\nyour profit:="<<iprofit<<endl;
cout<<"if you want enter data again\n";
cout<<"press 9 else enter any other number\n\n";
cin>>ko;
if(ko==9)
goto ass;
else
break;
}
else
cout<<"\n\n\ayou enter wrong password plz enter again:\n

\n";
goto passs;
}
case 2:
{
int kl;
cout<<"\n\nok thank you for using our program\n\n";
cout<<"are you want to exit program\n";
cout<<"\nenter 1 for no\n";
cout<<"\npress any other number for yes\n";
cin>>kl;
if(kl==1)
goto ass;
else
break;
}
case 3:
{
goto ass;
}
default:
cout<<"\ninvalid number\n";
goto go;
break;
}
}
int opp;
cout<<"if you want to calculate any thing\n";
cout<<"press 9 for yes\n";
cout<<"otherwise press any other number\n";
cin>>opp;
switch(opp)
{
int ll;
case 9:
calculator();
cout<<"if you want to renter data\n";
cout<<"press 4\n";
cout<<"else program will exit\n";
cin>>ll;
if(ll==4)
goto ass;
else
break;
default:
break;
}
getch();
}
//user define function//
void calculator()
{
int a,b;

char oppp;
int abc;
h:
cout<<"\n\nare you want to calculate \n";
cout<<"values\n";
cout<<"enter 1 for yes\n";
cout<<"else enter any other number:\n";
cin>>abc;
switch(abc)
{
case 1:
cout<<"\n";
ppp:
cout<<"enter first value"<<endl;
cin>>a;
cout<<"enter operator"<<endl;
cin>>oppp;
cout<<"enter secound values"<<endl;
cin>>b;
switch(oppp)
{
case '+':
cout<<"="<<a+b;
goto h;
break;
case '-':
cout<<"="<<a-b;
goto h;
break;
case '*':
cout<<"="<<a*b;
goto h;
break;
case '/':
if(b==0)
{
cout<<"invalid number"<<endl;
cout<<"enter again"<<endl;
goto ppp;
}
else
cout<<"="<<a/b;
goto h;
break;
case '%':
cout<<"="<<a%b;
goto h;
break;
default:
cout<<"invalid number:";
goto h;
}
default:

break;
}
}

Das könnte Ihnen auch gefallen