Class 'Dollar' for the program 2
| 96 | |
| 97 | // Class 'Dollar' for the program 2 |
| 98 | class Dollar |
| 99 | { |
| 100 | private: |
| 101 | float currency, mktrate, offrate; |
| 102 | |
| 103 | public: |
| 104 | Dollar() |
| 105 | { |
| 106 | currency = 100; |
| 107 | mktrate = 9000; |
| 108 | offrate = 7000; |
| 109 | } |
| 110 | float getDollar() |
| 111 | { |
| 112 | cout << endl |
| 113 | << "Currency: " << endl; |
| 114 | return currency; |
| 115 | } |
| 116 | float getMarketSoums() |
| 117 | { |
| 118 | cout << "Markent currency: " << endl; |
| 119 | return currency * mktrate; |
| 120 | } |
| 121 | float getofficialSoums() |
| 122 | { |
| 123 | cout << "Official currency:" << endl; |
| 124 | return currency * offrate; |
| 125 | } |
| 126 | void setRates() |
| 127 | { |
| 128 | cout << "Enter current market rate: " << endl; |
| 129 | cin >> mktrate; |
| 130 | cout << "Enter current official rate: " << endl; |
| 131 | cin >> offrate; |
| 132 | } |
| 133 | friend void operator<<(ostream &output, Dollar &p); |
| 134 | }; |
| 135 | |
| 136 | void operator<<(ostream &output, Dollar &p) |
| 137 | { |
nothing calls this directly
no outgoing calls
no test coverage detected