#include <iostream>
using namespace std;
struct Bid {
public:
Bid(int id, float price, short int pages) {
this->id = id;
this->price = price;
this->pages = pages;
}
int Get_id() { return id; }
float Get_price() { return price; }
short int Get_pages() { return pages; }
void Set_id(int id) { this->id = id; }
void Set_price(float price) { this->price = price; }
void Set_pages(short int pages) { this->pages = pages; }
float Get_themostcostly(Bid book) {
return book.Get_price() > price ? book.Get_price() : price;
}
private:
int id;
float price;
short int pages;
};
int main() {
Bid B1(0, 10, 500), B2(1, 15, 1000);
cout << B1.Get_themostcostly(B2) << endl;
cout << B1.Get_id() << endl;
cout << B1.Get_pages() << endl;
cout << B1.Get_price() << endl;
}
Comments