This activity uses a 3rd party app. Though your activity may be recorded a refre
ID: 3861944 • Letter: T
Question
This activity uses a 3rd party app. Though your activity may be recorded a refresh may be required to update the banner to the left. A currency exchange booth exchanges 1 US dollar to 119.771 Japanese yen. The currency exchange booth rounds down to the nearest yen Assign Total Yen with the amount of yen distributed to a customer given total Dollars. Ex if total Dollars is 10 dollars then total Yen is 1197. function total Yen = Convert To Yen(total Dollars) % total Dollars: Amount to convert in dollars % Assign total Yen with the amount of yen distributed given total Dollars % Exchange rate is 119.771 Japanese yen for 1 US dollar total Yen = 0; end Code to call your function when you click Run Convert To Yen(10)Explanation / Answer
The Matlab function ConvertToYen.m
function totalYen = ConvertToYen(totalDollars)
% totalDollars: Amount to convert in dollars
% Assign totalYenwith the amount of yen distributed given totalDollars
% Exchange rate is 119.771 Japanese yen for 1 US dollar
totalYen = floor(totalDollars*119.771);
end
Calling the function ConvertToYen.m
>> totalYen = ConvertToYen(10)
totalYen =
1197