Search This Blog

Tuesday, September 13, 2016

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 every Singapore dollar in increments of 1 dollar until 25 dollars.

Question: 

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 every Singapore dollar in increments of 1 dollar until 25 dollars.

Sample Output to be as follows:

     SGD    USD    GBP    EURO
       1          -           -           -
       2          -           -           -
       3          -           -           -
        .          .
        .          .
      25          -           -           -


Answer:


clc
clear all
fprintf(' \n  SGD...  USD      GBP      EURO\n\n');

for (SGD=1:25)
        USD = SGD*0.740;
        GBP = SGD*0.550;
        EURO = SGD*0.660;
        fprintf('%3d  =  %5.2f    %5.2f     %5.2f\n', SGD, USD, GBP, EURO);


end


[ N.B:
This question may have different answer, but this one is very easy & you have to   just change dollar rate respect to USD,  GBP, EURO ]



1 comment:

  1. Hi there, I discovered your blog per Google bit searching for such kinda educational advise moreover your inform beholds very remarkable for me. convert 7.99

    ReplyDelete