• Canadian dollars (rate: 1 U.S. dollar = 1.4680 Canadian dollars)
• Mexican Peso (rate: 1 U.S. dollar = 9.5085 pesos)
• English Pounds (rate: 1.6433 dollars = 1 pound)
• Japanese Yen (rate: 1 U.S. dollar = 104.9200 yen)
• French francs (rate: 1 U.S. dollar = 6.2561 francs)
Test inputs base on the currency type above.
I first:
1. Input 146.8 Canadian dollars and the result should come out as 100 US dollars.
2. Input 950.85 and the result should be 100 US dollars also
3. Input 100 pounds and the result should be 164.33 US dollars.
4. Input 10492 yen and the result should be 100 US dollars.
5. Input 625.61 francs and the result should also be 100 US dollars.
• After checking that the calculations are correct, I would also need to input 0 and 2,100,000 to see if the error message works. It should say, “Error invalid amount”.
• I would input a 6 in the choose currency type and it should display, “Exiting conversion program.
• Lastly I would enter 7 in the choose currency type and it should display, “Error: Invalid amount”.
Main Module Declare currency amount as integer Declare currencytype as integer Declare Othercountryvalue as real Declare USAValue as real Do While user continues Display menu Get Othercountryvalue Convert currency Display results End loop Print exit message End Main Module Display Menu Set continue = true While continue = true Display “Welcome to the foreign currency conversion program” Display “Choose a currency to convert” Display “Foreign 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 program” Display “Choose a currency type” Input currencytype If currencytype >= 1 and currencytype <= 5 then Set continue = false else if currencytype = 6 Display “Exiting conversion program” Continue = false Else Display “Error: This choice does not exist” Continue = true end if end while End Display Menu Get Othercountryvalue Declare value as integer Declare continue as real Set continue = true While continue = true Display “Enter currency amount:” Input othercountryvalue If othercountryvalue > 0 and othercountryvalue <= 2000000 then Continue = false else Display “Error: Invalid amount” Continue = true end if end while End get othercountryvalue Convert currency amount Declare rate as real Select choice of currencytype choice 1: Set rate = 1.4680 choise 2: Set rate = 9.5085 choice 3: Set rate = .6085 choice 4: Set rate = 104.9200 choice 5: Set rate = 6.2561 default: Set rate = 0 End Convert Currency Output Currency Results Declare country as string Declare currency as string Select choice of currencytype choice Canadian: country = “Canadian” currency = “Dollars” choice Mexican: country = “Mexican” currency = “Pesos” choice English: country = “English” currency = “Pounds” choice Japanese: country = “Japanese” currency = “Yen” choice French: country = “French” currency = “Francs” default: country = “No country” currency = “0” End choice if currency <>”” then Display “Your currency value:” othercountryvalue, “”, country,””,currency, “is”, USAValue, “dollars” else Display “Error: Incorrect type of currency.” end if End Output Currency Results

New Topic/Question
Reply




MultiQuote




|