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

Wap to calculate total marks and percentage of 3 subjects, WAP TO ACCEPT MA...

WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE #include stdio.h> #include conio.h>   void main() {            int M1,M

Restart, how to create program in c that will system restart

how to create program in c that will system restart

File Input and Output, Given a bool variable isReadable write some statem...

Given a bool variable isReadable write some statements that assign true to isReadable if the file "topsecret" exists and can be read by the program and assigns false to isR

Board coloring, color representation 0,1,2,3,4,5,6,7...

color representation 0,1,2,3,4,5,6,7...

Padovan string, write a program that counts the number of occurrences of th...

write a program that counts the number of occurrences of the string in the n-th padovan string p(n)   program 1 : package test.padovanstring; public class PadovanString {

Object oriented programming, implementation of the power and factorial in p...

implementation of the power and factorial in programs

Write a program read words from file, Write a program IdentyfyWordsMain.jav...

Write a program IdentyfyWordsMain.java reading a fi le (like HistoryOfProgramming) and divide the text into a sequence of words (word=sequence of letters). Save the result in a new

Least coast method, Find out initial basic feasible solution for the given ...

Find out initial basic feasible solution for the given transportation problem using Least Cost Method (LCM).

COMPILER DESIGN, aj is a newbie to the programming and while learning the p...

aj is a newbie to the programming and while learning the programming language he came to know the following rules: - Each program must start with ''{'' and end with ''}''.

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