Monday, January 18, 2010

Provide test cases for both valid and invalid values.?

test cases should cover menu selection, international value input, currency conversion and integration test cases (not just one each; potentially each of them can have multiple test cases).


Psuedocode


Main Module





Declare selection as integer


Declare currencyType as Integer


Declare internationalValue as real


Declare USValue as real





Do While user wants to continue


Display Menu


Get International Value


Convert Currency


Display Results


End loop


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 currencyType





If currencyType %26gt;= 1 AND currencyType %26lt;= 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 %26gt; 0 AND internationValue %26lt;= 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 = .6085


case 4:


Set rate = 104,9;


case 5:


Set rate = 6.2561


default:


Set rate = 0.0


End Case


USValue = rate * internationalValue





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 %26lt;%26gt; “” then


Display “The value of “, internationalValue, “ “ , nation, “ “, currency, “ is “,


usValue, “ dollars”


else


Display ';Error 5: Invalid currency type.';


end if





End Display ResultsProvide test cases for both valid and invalid values.?
May be you can contact a freelance programmer to do your project assignment. Check websites like http://askexpert.info/

No comments:

Post a Comment