Answer on Question #67543, Programming & Computer Science / MatLAB
Write a matlab script to display currency conversion for US dollar, british pound, euro with singapore dollar as the base currency. your output should show the equivalent values for USD, GBP, EURO for ever singapore dollar in increments of 1 dollar until 25 dollars.
Sample Output to be as follows:
Solution:
clc
clear all
rates = [1 0.71571 0.55953 0.66517]; % exchange rates
x = [1:25]'; % generates the numbers from 1 to 25
y = x*rates; % convert currencies
fprintf('SGD \t USD \t GBP \t EURO\n');
fprintf('%.2f \t %.2f \t %.2f \n', y')Output.
>>
Answer provided by www.AssignmentExpert.com
Comments