Week4 Pseudocode
Week4 Pseudocode
OUTPUT: Currency value and equivalent US dollar value { option := 0; value := 0; converted := 0; write(*** Currency Convertor ***); write(1. Canadian dollars to US dollars); write(2. Mexican pesos to US dollars); write(3. English pounds to US dollars); write(4. Japanese yen to US dollars); write(5. French francs to US dollars); write(Enter the choice:); read(option); write(Enter the amount:); read(value); if ( option := 1), then converted := value * (1/1.468); else if (option := 2), then converted := value * (1/9.5085); else if ( option := 3), then converted := value * 1.6433; else if ( option := 4), then converted := value * (1/104.92); else if ( option := 5), then converted := value * (1/6.2561); else write(Wrong Menu Selection); write(Entered Value:,value); write(US dollar equivalent:,converted); }
Other Format:
Module Main() Declare option = 0; Declare value = 0; Declare converted = 0; Display(*** Currency Convertor ***); Display(1. Canadian dollars to US dollars); Display(2. Mexican pesos to US dollars); Display(3. English pounds to US dollars); Display(4. Japanese yen to US dollars); Display(5. French francs to US dollars); Display(Enter the choice:); Get option; Display(Enter the amount:); Get value; if ( option := 1), then converted := value * (1/1.468); else if (option := 2), then converted := value * (1/9.5085); else if ( option := 3), then converted := value * 1.6433; else if ( option := 4), then converted := value * (1/104.92); else if ( option := 5), then converted := value * (1/6.2561); else Display(Wrong Menu Selection); End If Display(Entered Value:,value); Display(US dollar equivalent:,converted); END Main MODULE