0% found this document useful (0 votes)
38 views

Week4 Pseudocode

The currency_convertor algorithm allows users to input a currency type and value and outputs the equivalent value in US dollars. It displays a menu for the user to select the currency to convert from, prompts them to enter an amount, then performs the conversion calculation based on the selection and displays the original and converted values.

Uploaded by

Termaine Johnson
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Week4 Pseudocode

The currency_convertor algorithm allows users to input a currency type and value and outputs the equivalent value in US dollars. It displays a menu for the user to select the currency to convert from, prompts them to enter an amount, then performs the conversion calculation based on the selection and displays the original and converted values.

Uploaded by

Termaine Johnson
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program Pseudocode: Algorithm currency_convertor() INPUT: Currency type and currency value from user.

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

You might also like