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

Assignment Help:

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();

    }


Related Discussions:- Program is to perform all the functions of super bazaar

Specifying and working rules of a class, Specifying a Class: As discuss...

Specifying a Class: As discussed a class is defined to develop an algorithm and bind it together in a core shell. A class is an abstract data type (ADT).  The binding of dat

Explain concept of object initialization, Object Initialization An obje...

Object Initialization An object of a derived class can be initialized to an object of a base class. If both the classes have similar data members, then no specific constructor

Basic concepts, what is the diffeerence between c and c++

what is the diffeerence between c and c++

Student, Ask4. Write a query to display the columns listed below. The query...

Ask4. Write a query to display the columns listed below. The query should list each customer in which the video rental is overdue. The Days_Overdue column should calculate the numb

Write a Programme that computes the price of portfolio, write a programme t...

write a programme that computes the price of shares and options. do the options in one-period binomial model.

C program for change the case in title case, #include stdio.h> #include ...

#include stdio.h> #include conio.h> #include ctype.h> #include string.h>   void main() {           int i=0,j=0,length;           char a[30];           cl

Why do c++ compilers require name mangling?, A: Name mangling is the rule a...

A: Name mangling is the rule according to which C++ modify function's name into function signature before passing that function to a linker. It is how the linker differentiates amo

Minimum total number of shelves, At a shop of marbles, packs of marbles are...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Xmugler, #solution for decode the code for smuglers

#solution for decode the code for smuglers

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd