Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- файл DeliveryInformation.h
- #pragma once
- #include <iostream>
- #include "ProductInformation.h"
- using namespace std;
- class DeliveryInformation: public ProductInformation
- {
- private:
- float charges_;
- string customer_;
- string supplyer_;
- public:
- DeliveryInformation() :ProductInformation(), charges_(0.0), customer_(""), supplyer_(""){};
- //~DeliveryInformation();
- float getCharges() const { return charges_; };
- string getCustomer()const { return customer_; };
- string getSupplyer() const { return supplyer_;};
- float getAmountOfProduct() const { return amountOfProduct_; };
- float getProductPrice() const { return productPrice_;};
- string getProductName() const { return productName_; };
- void setCharges(float charges) { charges_ = charges;};
- void setCustomer(string customer) { customer_ = customer; };
- void setSupplyer(string supplyer) { supplyer_ = supplyer; };
- void setAmountOfProduct(float amountOfProduct){ amountOfProduct_ = amountOfProduct;};
- void setProductPrice(float productPrice) { productPrice_ = productPrice;};
- void setProductName(string productName) {productName_ = productName;};
- void createNewProduct();
- void deleteOneProduct();
- friend istream& operator >> (istream& input, DeliveryInformation& obj) {
- input >> obj.productName_ >> obj.amountOfProduct_ >> obj.productPrice_ >>
- obj.charges_ >> obj.supplyer_ >> obj.customer_;
- return input;
- };
- friend ostream& operator << (ostream& output, DeliveryInformation& obj) {
- output << obj.productName_ << "\n" << obj.amountOfProduct_ << "\n" << obj.productPrice_
- << "\n" << obj.charges_ << "\n" << obj.supplyer_ << "\n" << obj.customer_ << "\n";
- return output;
- };
- };
- файл ProductInformation.h
- #pragma once
- #include <iostream>
- using namespace std;
- class ProductInformation
- {
- protected:
- float amountOfProduct_;
- string productName_;
- float productPrice_;
- public:
- ProductInformation() : amountOfProduct_(0.0),
- productName_(""), productPrice_(0.0) {};
- //~ProductInformation();
- virtual float getAmountOfProduct() const = 0;
- virtual float getProductPrice() const = 0;
- virtual string getProductName() const = 0;
- virtual void setAmountOfProduct(float) = 0;
- virtual void setProductPrice(float) = 0;
- virtual void setProductName(string) = 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement