In: Mechanical Engineering
1. (USE MATLAB) Create a table using fprintf that shows the conversion from US Dollars to Yen, Euros, Mexican Peso, and Canadian Dollars. Use the internet to find the conversion factors. Prompt the user for the US Dollar amounts they want to see conversions for.
MATLAB CODE:
clear all
clc
US_dollars = input("Enter amount value in US dollars");
Yen = US_dollars*106.84;
Euro = US_dollars*0.86;
Mexican_pesos = US_dollars*22.49;
Canadian_dollars = US_dollars*0.75;
fprintf('Table of US dollar in different currencies\n')
fprintf('US dollars\t Yen\t Euro\t Mexican Peso\t Canadian dollars\n')
fprintf(' %0.2f\t %0.2f\t %0.2f\t %0.2f\t %0.2f\n',[US_dollars;Yen;Euro;Mexican_pesos;Canadian_dollars])