Start Main Module
Declare selection as integer
Declare currencyType as Integer
Declare internationalValue as real
End Main Module
Display Menu
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 currencyType
If currencyType >= 1 AND currencyType <= 5 then
elseif currencyType = 6
Display "Quitting Currency Conversion"
Display "Error 4: Invalid menu selection."
End Display Menu
Get International Value
Declare value as integer
Display "Enter a currency value (positive number): "
Input internationalValue
if internationalValue > 0 AND internationValue <= XXXXXXX then
Display "Error 1: Invalid input--Negative Number"
continue = true
Convert Currency
Declare rate as real
Select Case of currencyType
case 1:
Set rate = 1.4680
case 2:
Set rate = 9.5085
case 3:
Set rate = .6085
case 4:
Set rate = XXX.XXXX;
case 5:
Set rate = 6.2561
default:
Set rate = 0.0
End Case
USValue = rate * internationalValue
End Convert Currency
Display Results
Select Case of currencyType
case 1
nation = "Canadian"
currency = "Dollars"
case 2
nation = "Mexican"
currency = "Pesos"
case 3
nation = "English"
currency = "Pounds"
case 4:
nation = "Japanese"
currency = "Yen"
case 5
nation = "French"
currency = "Francs"
default:
nation = "No country"
currency = ""
end case
Display "The value of ", internationalValue, " " , nation, " ", currency, " is ", USValue, " dollars"
Display "Error 5: Invalid currency type."
End Display Results
Attachment:- Appendix A.zip