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

L is a text and can be composed of any of the characters {, }, (, ) , and P, where P will represent the instruction. L will contain single spaced characters where each character

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

In the Byteland country a string "s" is said to super ascii string if and only if count of each charecter in the string is equal to its ascci value in the byteland country ascii co

2 flowcharts, pseudocode for each (at least 4 algorithms), and code for either a stack or a queuestion..

why c is middle level language?

What is the difference among const char *myPointer and char *const myPointer?  A: Const char *myPointer is a non constant pointer to constant data; whereas char *const myPointer

how to write c code to solve assignment problem?


Define the Relational Operator in c language? The Relational operators refer to the relationships that values can have with one another and they are used to compare two operand