Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions