Question: Problem 1 - 25 points a. Write a function dollars TOLBP) that takes as parameters an amount in dollars (of type double) and an exchange

 Problem 1 - 25 points a. Write a function dollars TOLBP)that takes as parameters an amount in dollars (of type double) and

Problem 1 - 25 points a. Write a function dollars TOLBP) that takes as parameters an amount in dollars (of type double) and an exchange rate of type integer), and returns the equivalent of the amount in LBP. If the exchange rate is equal to 1, the program considers 18 = 1515 LBP. If the exchange rate is equal to 2, the program considers 1$ = 3900 LBP. If the exchange rate is equal to 3, the program considers 1$ = 8900 LBP. b. Write a C++ program that: Asks the user to enter an amount in dollars (of type double) Asks the user to enter an exchange rate (of type integer) Use the function of Part a to calculate the equivalent in LBP. Prints on the screen the result of the function. Sample Runs Please enter the amount in dollars: 20 Exchange rate (1: Official, 2: Bank, 3: Black Market)? 1 20 $ is equal to 30300 LBP Please enter the amount in dollars: 20 Exchange rate (1: Official, 2: Bank, 3: Black Market)? 2 20 $ is equal to 78000 LBP Please enter the amount in dollars: 20 Exchange rate (1: Official, 2: Bank, 3: Black Market)? 3 20 $ is equal to 177000 LBP double dollarsToLBP(double, int); int main() { double dollars, LBP; int exchange Rate; double dollarsToLBP(double, int); int main() double dollars, LBP; int exchangeRate; return 0; } double dollarsToLBP { ) }

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!