# Currency Converter

## Problem Statement

The company ABC wants to build a currency converter.

Write a function that has the source currency amount, and exchange rate as parameters, and return the resulting target currency amount.

Target currency amount = Source currency amount * Exchange rate

## Input

The first line of input is a float number: amount, representing the amount of source currency.

The second line of input is a float number: rate, representing the rate of exchange from source currency to target currency.

## Output

Print the target currency amount.

## As is

The boilerplate code is already there to read the inputs from user, in the main() function, and to print the value returned by the targetCurrencyAmount() function. Do not edit this code.

## To do ✍

targetCurrencyAmount() has two parameters: amount and rate. Complete the function that calculates the target currency amount, and returns the same.

## Example 1

For the example, let us say we are converting Dollar to INR. And the input is 10 dollars with an exchange rate of 81.06.

Test input

10
81.06

Test output

810.6

Explanation

For each dollar, we get 81.06INR. Therefore for 10 dollars, the converted value is 10 * 81.06 = 810.6.

## Python Program

# Complete the following function
# Return target currency amount that's calculated
#     from amount, rate
def targetCurrencyAmount(amount, rate):

# Boilerplate code - Do not edit the following
def main():
amount = float(input())
rate = float(input())
# Print only last two digits
print("%.2f" % targetCurrencyAmount(amount, rate))

if __name__ == "__main__":
main()

Input and Outputs 1

9.5
78.80
748.60

Input and Outputs 2

21.03
0
0.00

Input and Outputs 3

56.16
79.99
4492.24

Input and Outputs 4

90.11
78.94
7113.28
# Complete the following function
def targetCurrencyAmount(amount, rate):
return amount * rate

# Boilerplate code - Do not edit the following
def main():
amount = float(input())
rate = float(input())
# Print only last two digits
print("%.2f" % targetCurrencyAmount(amount, rate))

if __name__ == "__main__":
main()