Tuesday, January 10, 2017

SUPER-MARKET BILLING CONSOLE APPLICATION

 #include<iostream>
using namespace std;

int main()
{
int n=0; float T=0;
  cout<<"Welcome to Yashtosh Mart !\n"<<endl;
  cout<<"Type total number of items bought"<<endl;
  cin>>n;

    float t[n];
   string itemName[n]; float quantity[n]; float rate[n];
   for(int j=0;j<n;j++)
   {   string s; float k,r;
       cout<<"input Name of item "<<j+1<<" <SPACE> Quantity <SPACE> rate press<ENTER>"<<endl;
       cin>>s>>k>>r;
       itemName[j]=s;
       quantity[j]=k;
       rate[j]=r;
   }
  for(int i=0;i<n;i++)
  {cout<<itemName[i]<<" "<<quantity[i]<<" "<<rate[i]<<" "<<"costing Rs."<<quantity[i]*rate[i]<<endl;
      t[i]=quantity[i]*rate[i];

     T= T+t[i];
   //cout<<"Your Grand Total = Rs."<<t<<endl;
  }
  cout<<"Your Grand Total = Rs."<<T<<endl;
    return 0;
}

No comments:

Post a Comment

Derivatives stock list at NSE

Complete FNO stock list at NSE. ABB India Ltd ACC Ltd APL Apollo Tubes Ltd AU Small Finance Bank Ltd Aarti Industries Ltd Abbott India Ltd A...