Question: 28 The following program generates an error. Why? 0 class Currency { public: private: }; } string toCurrency; Currency Currency::Convert(int amt, string toCurr) { Currency

28 The following program generates an error. Why? 0 class Currency { public: private: }; } string toCurrency; Currency Currency::Convert(int amt, string toCurr) { Currency myMoney; if (toCurr = "Euro") { int amount; Currency Convert(int amt, string toCurr); } myMoney amount = amt * .89; } else if (toCurr == "Yen") { myMoney amount =amt 108.67; } return myMoney; int main() { int amountIn; string strCurr; Currency newMoney; cout<<"Enter the amount to convert and currency:" cin >> amountIn; cin >> strCurr; newMoney = newMoney. Convert(amountIn, strCurr); return 0; 1 pts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!