Question: Construct a C++ program using function to calculate how much Malaysian Ringgit (RM) would be required to buy either US Dollar, European Euro or Japanese

Construct a C++ program using function to calculate how much Malaysian Ringgit (RM) would be required to buy either US Dollar, European Euro or Japanese Yen. The function has the following prototype:

double BuyCurrency (char, double);

The first parameter is for the type of currency where the character D, E and Y would be used to represent Dollar, Euro and Yen respectively. The second parameter would be the amount of money to be bought. The function would return the amount of Malaysian ringgit (RM). The exchange rate is given as follows:

(Dollar) $1 = RM3.80; (Euro) 1 = RM4.70; (Yen) 100 = RM3.60;

Construct a C++ program that will prompt the user to enter the currency preferred and the amount. The program would display the amount in Malaysian Ringgit that would have to be paid to buy the currency.

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!