Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include "inventory.h"
- #pragma once
- #include <iostream>
- using namespace std;
- class Inventory //string, description, int balance stock
- {
- string productDesc;
- int stock;
- private:
- Inventory(string p0, int s8) // constructor for checking balance, p0, s8
- {
- productDesc = p0;
- stock = s8;
- if (stock >= 20) {
- cout << "This product is stocked" << endl;
- }
- else
- {
- cout << "Not enough stock" << endl;
- }
- //initialproduct() {
- }
- public: //functions
- void Purchase(int a)
- {
- stock = stock + a;
- }
- int Sale(int b)
- {
- stock = stock - b;
- if (stock >> 20)
- {
- cout << "This product has enough amount " << endl;
- }
- else
- cout << "Please restock" << endl;
- }
- void setStock(int c)
- {
- stock = c;
- }
- void getStock()
- {
- //return Stock;
- }
- };
- int main()
- {
- int purchase;
- int sale;
- cout << "Enter purchase" << endl;
- cin >> purchase;
- cout << "Enter sale" << endl;
- cin >> sale;
- cout << "Stock balance is " << purchase << endl;
- //Inventory myInventory;
- //Inventory myInventory;
- //myInventory.setStock(purchase);
- //cout << "Stock balance is " << myInventory.getStock() << endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement