Advertisement
cperryoh

InventoryItem class

Mar 12th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #pragma
  2. #include <iostream>
  3. class InventoryItem {
  4.     private:
  5.         int id;
  6.         float price;
  7.     public:
  8.         int getId() {
  9.             return id;
  10.         }
  11.         float getPrice() {
  12.             return price;
  13.         }
  14.     InventoryItem() {
  15.         id = 0;
  16.         price = 0;
  17.     }
  18.     InventoryItem(int _id, float _price) {
  19.         id = _id;
  20.         price = _price;
  21.     }
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement