MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / Dollar

Class Dollar

Lab_13/main1.cpp:98–134  ·  view source on GitHub ↗

Class 'Dollar' for the program 2

Source from the content-addressed store, hash-verified

96
97// Class 'Dollar' for the program 2
98class Dollar
99{
100private:
101 float currency, mktrate, offrate;
102
103public:
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
136void operator<<(ostream &output, Dollar &p)
137{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected