Hello, I need some help!
I need to genreate a set of test inputs and expected results for the currency conversion program below.
I also have to use the folowing format
Test Case <put number here>:
Inputs: Menu Selection = <put number here>
Expected Outputs: <put expected output here>
Currency_Type:
I need to include a hierarchy and flow chart
Can some help me?
Currency Conversion Porgram
Main Menu
Declare InternationalCurrency As String
Declare InternationalValue As Real
Write “InternationalValue”
Write “This program computes International,”
Write “Currency Types.”
Call Display Menu module
Call Get International Value module
Call Currency Conversion Module
Call Display Results Module
Display_Results(Calculate)
End Main Menu
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 currencyType
If currencyType >= 1 AND currencyType <= 5 then
Set continue = false
else if currencyType = 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 internationalValue
if internationalValue > 0 AND internationValue <= 1000000 then
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 CurrencyType
case 1:
Set rate = 1.4680
case 2:
Set rate = 9.5085
case 3:
Set rate = 1.6433
case 4:
Set rate = 104.920
case 5:
Set rate = 6.2561
default:
Set rate = 0.0
End Case
USValue = rate * internationalValue
end While
End Convert Currency
Display Results
Declare nation as string
Declare currency as string
Select Case of currencyType
case CANADIAN:
nation = "Canadian";
currency = "Dollars";
case MEXICAN:
nation = "Mexican";
currency = "Pesos";
case ENGLISH:
nation = "English";
currency = "Pounds";
case JAPANESE:
nation = "Japanese";
currency = "Yen";
case FRENCH:
nation = "French";
currency = "Francs";
default:
nation = "No country";
currency = "";
End Case
if currency <> “” then
Display “The value of “, internationalValue, “ “ , nation, “ “, currency, “ is “,
usValue, “ dollars”
else
Display "Error 5: Invalid currency type."
end if
End Display Results