Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following program generates an error. Why? #include #include using namespace std; class CurrencyConverter { public: string toCurrency; private: int amount; CurrencyConverter ConvMoney ( int
The following program generates an error. Why?
#include
#include
using namespace std;
class CurrencyConverter
public:
string toCurrency;
private:
int amount;
CurrencyConverter ConvMoneyint amt, string toCurr;
;
CurrencyConverter CurrencyConverter::ConvMoneyint amt, string toCurr
CurrencyConverter myMoney;
if toCurr "Euro"
myMoney.amount amt ;
else if toCurr "Yen"
myMoney.amount amt ;
return myMoney;
int main
int amountIn;
string strCurr;
CurrencyConverter newMoney;
cout "Enter the amount to convert and currency:";
cin amountIn;
cin strCurr;
newMoney newMoney.ConvMoneyamountIn strCurr;
return ;
Group of answer choices
The object newMoney should be created using a vector.
The function ConvMoney should be made public to call it in main.
The class should be made in separate files.
Only the amount should be passed as an argument to the function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started