Premium Essay

Conersion

In:

Submitted By jojopaige
Words 892
Pages 4
CONVERSION:

Main Module

Declare selection as integer
Declare currency type as integer
Declare international value as real
Declare US value as real Do while user wants to continue
Call display Menu
Call get international value
Call convert currency
Call display results
End while
Print exit message
End main module

Display Menu Declare continue as Boolean
Set continue = true
While continue = true
Display "Welcome to the international currency conversion program"
Display "Please make a selection"
Display "International Currency Types:"
Display "1: Canadian Dollars"
Display "2: Mexican Pesos"
Display "3: English Pounds"
Display "4: Japanese Yen"
Display "5: French Francs"
Display "6: Quit"
Display "Enter a selection: ";

Input currency type

If currency type >= 1 and currency type <= 5 then
Set continue = false else if currency type = 6
Display “Quitting Currency Conversion” continue = false else Display "Error 4: Invalid menu selection." continue = true end if end While
End Display Menu

Get International Value

Declare value as integer
Declare continue as Boolean
Set continue = true
While continue = true
Display "Enter a currency value (positive number):"
Input international value if international value > 0 and international value <=(NNN) NNN-NNNNthen continue = false else Display "Error 1: Invalid input--Negative Number" continue = true end if end while

End Get International Value

Convert Currency

Declare rate as real
Select Case of currency type case 1:
Set rate = 1.4680 case 2:
Set rate = 9.5085 case 3:
Set rate = .6085 case 4:
Set rate = 104,9; case 5:
Set rate = 6.2561 default: Set rate = 0.0
End Case
US value = rate * international value

End Convert Currency Display Results

Declare nation as string
Declare currency as string
Select

Similar Documents