-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.h
More file actions
31 lines (25 loc) · 1019 Bytes
/
Copy pathItem.h
File metadata and controls
31 lines (25 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//Student Bshara Haj, 212590186.
//Student Obaeda Khatib, 201278066.
#pragma once
#include <string>
#include <iostream>
using std::string;
//Item Class
class Item
{
static int nextId; //static integer for the next ID to be assigned
int id; //item's ID
int price; //item's price
string manufacturer; //item's manufacturer
public:
Item(int price, const string& manufacturer); //Constructor for the Item class
virtual ~Item(); //Virtual destructor
int getId() const; //to get ID
int getPrice() const; //to get the price
void setPrice(int price); //to set the price
string getManufacturer() const; //to get manufacturer
void setManufacturer(const string& manufacturer); //to set the manufacturer
virtual string toString() const; //Virtual method to get a string representation of the item
operator string() const; //Overloaded operator to convert the item to a string
static bool itemPtrCompare(const Item* a, const Item* b);
};