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
Conversion between Objects of Different Classes As the compiler does not know anything about the user-defined type, the conversion instructions are to be specified in a functio



External Variables Different functions of the similar program can be written in different source files and can be compiled together. The scope of a global variable is not limit

Molecular dynamics for a Lennard-Jones system (in C++) 1. Write a function which reads in the input variables of a molecular dynamics simulation of a Lennard-Jones system. The inpu

Defines the entry point for the console application. // #include "stdafx.h" #include #include #include"conio.h" using namespace std; double Determinant(double a[][3],int forde

a) Define an Asset base class that provides the following method: class Asset { public:      virtual double getValue()=0; };   This will be the base class for both stock an

Why shouldn't Matrix class's interface look like an array-of-array? A: Some people build a Matrix class that has an operator[] that returns a reference to an Array object (or po

what are objects or simply define objects

For the circuit shown in Figure, verify (a) the battery voltage V , (b) the total resistance of the circuit, and (c) the values of resistance of resistors R 1 , R 2 and