This activity uses a 3rd party app. Though your activity may be recorded a refre
ID: 3861922 • 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
%matlab code
function totalYen = ConvertToYen(totalDollar)
% calculate yen
totalYen = totalDollar*119.771;
%round to nearest integer
totalYen = round(totalYen);
end
ConvertToYen(10)
%output: ans = 1198