Hi,

I need some input on an assignment I am doing. I am not sure if I even did this assignment right or not. So any help would be appreciated.

My assignment is to generate a test input based on the Currency Conversion program.


International currency type

• 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)

Here is my Test inputs based on the currency above.


1. Input 146.8 Canadian dollarsand the result should come out as 100 U.S.
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.


• To check 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.
• For the last part 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
[IMG]http://forum.codecall.net/images/onlydev/misc/progress.gif[/IMG]

Hi,

I need some input on an assignment I am doing. I am not sure if I even did this assignment right or not. So any help would be appreciated.

OK. Input is:
Start writing the program.
Write the input module and test it.
Write the output module and test it.
Add the conversion module for one currency and test it.
Add the other conversions and test it.

Be sure to post code in CODE tags when you need help on what you've written.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.