Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include<iostream>
- #include<string>
- using namespace std;
- class Taryf {
- protected:
- string nomer;
- string month;
- double cost;
- public:
- Taryf():nomer(), month(), cost(0){}
- Taryf(string n, string m,double c): nomer(n),month(m),cost(c){}
- Taryf(const Taryf&t): nomer(t.nomer),month(t.month),cost(t.cost){}
- string get_nomer() const {
- return nomer;
- }
- virtual double get_suma()const {
- return cost;
- }
- friend ostream& operator<<(ostream& out, const Taryf& t) {
- out << "Number:" << t.nomer << "\t" << "Month:" << t.month << "\t" << "Cost:" << t.cost << "$" << endl;
- return out;
- }
- friend istream& operator>>(istream& in, Taryf& t) {
- in >> t.nomer;
- in >> t.month;
- in >> t.cost;
- return in;
- }
- void print() const {
- cout<< "Number:" << nomer << "\t" << "Month:" << month << "\t" << "Cost:" << cost << "$" << endl;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement