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;
}

Friday, January 6, 2017

SUPER-MARKET BILLING SOFTWARE IN C++

// SUPER-MARKET BILLING SOFTWARE IN C++
#include<iostream>
using namespace std;

int main()

{  string item, item1,item2;
    float weight,weight1,weight2, totalcost, totalcost1, totalcost2,cost, cost1, cost2;

   cout<< "Enter the item 1 and press<Enter>:"<<endl;
   cin>>item;
  cout<< "Enter the weight of item 1 in kgs and press<Enter>:"<<endl;
  cin>> weight;
  cout<< "Enter the price/kg and press<Enter>:"<<endl;
  cin>>cost;

  cout<< "Enter the item 2 and press<Enter>:"<<endl;
   cin>> item1;
cout<< "Enter the weight of item 2 in kgs and press<Enter>:"<<endl;
cin>> weight1;
cout<< "Enter the price/kg  and press<Enter>:"<<endl;
    cin>> cost1;

cout<< "Enter the item 3 and press<Enter>C:"<<endl;
    cin>> item2;
cout<< "Enter the weight of item 3 in kgs and press<Enter>:"<<endl;
cin>> weight2;
cout<< "Enter the price/kg  and press<Enter>:"<<endl;
cin>>cost2;


   totalcost = weight*cost;
  totalcost1  = weight1*cost1;
  totalcost2 = weight2*cost2;

    cout<<"Welcome ! To Yashtosh Mart"<<endl<<endl;
    cout<<"You bought following items from us"<<endl<<endl;
    cout<<item<<"   "   <<weight  <<" kgs  "<<"  @ "<<cost<<" Rs/kg " <<"Costing  Rs" <<totalcost<<endl;
    cout<<item1<<"  "    <<weight1  <<"kgs  "<<"  @ "<<cost1<<" Rs/kg " <<"Costing  Rs"<<totalcost1<<endl;
    cout<<item2<<"  " <<   weight2<<"   kgs  "<<"  @ "<<cost2<<" Rs/kg " <<"Costing  Rs"<<totalcost2<<endl;
    cout<<"\nGrand Total :  Rs. "<<totalcost1+totalcost2+totalcost<<endl;
    cout<<"Thanks for shopping with us!"<<endl<<endl;
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

   return 0;
}

Sunday, January 1, 2017

REVERSING A KNOWN STRING without using STACK

Hello code lovers !                                Happy New Year 2017 !            
//REVERSING A KNOWN STRING
#include<stdio.h>
int main()
{
    char c[]="Ashutosh_Kumar_Singh";
    for(int i=(sizeof(c)-1);i>=0;i--)
    {
        printf("%c",c[i]);
    }
return 0;
}

Reversing a word entered from keyboard in C without using 'stack'

Hello friends !                                                Happy New Year 2017 !

To  coders and code lovers all over  the world.........

I hope you will find this piece of code interesting. Please respond with alternative ideas/modifications to improve the code.
//Input a word at console from keyboard and get its reverse (without using STACK !)
#include<stdio.h>
int main()
{
    char c[]="                                            "; // Put enough white spaces (more than expected word size)
    printf("type a word :");
    scanf("%s",&c);
    for(int i=(sizeof(c)-1);i>=0;i--)
    {
        printf("%c",c[i]);
    }
return 0;
}

इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया - सुदर्शन फ़ाकिर

 इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया वरना क्या बात थी किस बात ने रोने ना दिया आप कहते थे कि रोने से ना बदलेंगे नसीब उमर भर आप की इस बात...