Program is to perform all the functions of super bazaar, C/C++ Programming

Program is to perform all the functions that are performed in a super bazaar:

class stock

  {

  private:

    int itno;

    char itname[20];

    char brname[20];

    float utprice;

    int quantity;

 

  public:

    stock() //  constructor for assigning initial values

      {

                itno=1;

                strcpy(itname, "deodrant");

                strcpy(brname, "oriflame");

                utprice=110;

                quantity=50;

      }

    void input();

    void info();

    void comp();

  };

 

 void stock::input()

   {

   clrscr();

   cout<<" enter the item no. "<<"\n";

   cin>>itno;

   cout<<" enter the name of commodity "<<"\n";

   cin>>itname;

   cout<<" enter the brand name of the commodity "<<"\n";

   cin>>brname;

   cout<<" enter the amount of quantity u want to purchase";

   cin>>quantity;

   }

  void stock::info()

    {

   clrscr();

   if(quantity<=50)

     {

     cout<<" the commodity is available "<<"\n";

     }

  else

    {

    cout<<" SORRY ! the stock has been finished ";

    exit(0);

    getch();

    }

     }

   void stock::comp()

    {

    clrscr();

    int net;

    net=quantity*utprice+10;// 10 taken as sales tax initially

    info(); // function called

    cout<<" the item number is: "<

    cout<<" the item name is: "<

    cout<<" the brand name of commodity is: "<

    cout<<" the  quantity is: "<

    cout<<" the unit price is: "<

    cout<<" net amount payable including sales tax (5%) is: "<

    }

 

  void main()

    {

    stock market;

    market.input();

    market.info();

    market.comp();

    }

Posted Date: 10/19/2012 5:30:34 AM | Location : United States







Related Discussions:- Program is to perform all the functions of super bazaar, Assignment Help, Ask Question on Program is to perform all the functions of super bazaar, Get Answer, Expert's Help, Program is to perform all the functions of super bazaar Discussions

Write discussion on Program is to perform all the functions of super bazaar
Your posts are moderated
Related Questions
We have used logic symbols in the past, but not really though about the actual real devices. Semiconductor companies have taken the logic symbols are manufactured them into logic f

Program to design list in c: Write a program in c to insert the values in list void main() { int i=0; char a[20]; clrscr(); printf("Enter the line\n");

What happens if you write following code? string& foo()

Write a c++ program to find the sum of 0.123 ??103 and 0.456 ??102 and write the result in three significant digits

#questio c++ program for drawing thick line

Syntax rules for writing a destructor function Its name is the similar as that of the class to which it belongs, except that the first character of the name is the symbol t

write a program to find area of curve y=f(x) between x and x=b,integrate between the limits a and b using c     #include float start_point, /* GL

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

write a program for convert numbers upto 9 to alphabet?Eg.now enter the inputis 666 means output is "0" lphabet

Q: When should you employ multiple inheritance? A:There  are  three  acceptable  answers:-  "Rarely," "Never," and  "while  the  problem  domain cannot be modeled accurately any