服务承诺
资金托管
原创保证
实力保障
24小时客服
使命必达
51Due提供Essay,Paper,Report,Assignment等学科作业的代写与辅导,同时涵盖Personal Statement,转学申请等留学文书代写。
51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标
51Due将让你达成学业目标私人订制你的未来职场 世界名企,高端行业岗位等 在新的起点上实现更高水平的发展
积累工作经验
多元化文化交流
专业实操技能
建立人际资源圈Currency_Conversion
2013-11-13 来源: 类别: 更多范文
Currency Conversion Test Procedure
Treasa Benner
Axia College
Currency Conversion Test Procedure
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 "World Wide Currency Types:"
Display "1: Canadian Dollars"
Display "2: Mexican Pesos"
Display "3: English Pounds"
Display "4: Japanese Yen"
Display "5: French Francs"
Display "6: End"
Display "Select Currency"
Input currencyType
If currencyType >= 1 AND currencyType <= 5 then
Set continue = false
else if currencyType = 6
Display “Ending Currency Conversion”
continue = false
else
Display “"Error 4: Invalid menu selection."
continue = true
end if
end While
End Display Menu
Display Menu Test Procedure
The user is asked to select an international currency type. When the user enters a number between 1 and 6 it will open a certain currency type. After this the program sets itself to false. If 6 is selected the program displays “Ending Currency Conversion.” If the user does not enter a number between 1 and 6 the program displays “Error 4: Invalid menu selection.” And continue is set to true.
Test Case 1,
Input: user enters 1 for Canadian Dollars,
set continue = false
Test Case 2
Input: user enters 2 for Mexican Pesos
set continue = false
Test Case 3
Input: user enters 3 for English Pounds
set continue = false
Test Case 4
Input: user enters 4 for Japanese Yen
set continue = false
Test Case 5
Input: user enters 5 for French Francs
set continue = false
Test Case 6
Input: user enters 6 for Quit
set continue = false
Test Case 7
Input: user enters 7
Output: Display “"Error 4: Invalid menu selection."
continue = true
The next module tested is the Get International Value module.
Get International Value
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
Get International Value Test Procedure
The user is prompted to enter a currency value that is a positive number. If the user enters a number greater then 0 and equal to or less then 1000000, continue is set to false. If the user enters 0, a negative number or a number greater then 1000000, the error message “"Error 1: Invalid input--Negative Number" is displayed. Then continue = true.
Test Case 1
Input: user enters 100.00
continue = false
Test Case 2
Input: user enters 1000.00
continue = false
Test Case 3
Input: user enters 10000.00
continue = false
Test Case 4
Input: user enters 100000.00
continue = false
Test Case 5
Input: user enters 1000000.00
continue = false
Convert Currency
Declare rate as real
Select 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
Convert Currency test procedure
If the user selects a valid currency in the Display Menu, the currencytype is used to determine which case to use. The rate is set according to the currency type the user selected. The rate is then multiplied by the international value from Get International Value to get the value is US dollars.
Test Case 1
Input: User input 1
the rate is set to 1.4680
Test Case 2
Input: User inputs 2
the rate is set to 9.5085
Test Case 3
Input: User inputs 3
the rate is set to .6085
Test Case 4
Input: User inputs 4
the rate is set to 104.9
Test Case 5
Input: User inputs 5
the rate is set to 6.2561
Test 1 ,
Input: internationalvalue = 100.00, currencytype= 1,
Output: USValue = 1.4680 * 100
USValue = 146.80
Test 2
Input: internationvalue = 1000.00, currencytype = 2
Output: USValue = 9.5085 * 1000,
USValue = 9508.50
Test 3,
Input: internationalvalue = 10000.00, currencytype = 3
Output: USValue = .6085 * 10000
USValue = 6085.00
Test 4
Input: internationalvalue = 100000.00, currencytype = 4
Output: USValue = 104.9 * 100000
USValue = 10490000.00
Test 5,
Input:internationalvalue = 1000000.00, currencytype = 5
Output: USValue = 6.2561 * 1000000
USValue = 6256100.00
The next module tested is the Display Results module.
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
Display Results test procedures
The user’s currency selection and international values are displayed as US dollars after the conversion calculations have been completed. This module is used to match the currency with the proper designation and value to display the values correctly. The nation and currency is displayed along with the value in US dollars.
Test Case 1
Input: currencytype = 1
Output: nation = Canadian, currency = Dollars
Test 1
Input: internationalvalue = 100.00, currencytype = 1, USValue = 146.80
Output: Display = “The value of 100.00 Canadian dollars is 146.80 dollars”
Test Case 2
Input: currencytype = 2
Output: nation = Mexican, currency = Pesos
Test 2
Input: nternationalvalue = 1000.00, currencytype = 2, USValue = 9508.50
Output: Display = “The value of 1000.00 Mexican Pesos is 9508.50 dollars”
Test Case 3
Input: currencytype = 3
Output: nation = English, currency = Pounds
Test 3
Input: internationalvalue = 10000.00, currencytype = 3, USValue = 6085.00
Output: Display = “The value of 10000.00 English Pounds is 6085.00 dollars”
Test Case 4
Input: currencytype = 4
Output: nation = Japanese, currency = Yen
Test 4
Input: internationalvalue = 100000.00, currencytype = 4, USValue = 10490000.00
Output: Display = “The value of 100000.00 Japanese Yen is 10490000.00 dollars”
Test Case 5
Input: currencytype = 5
Output: nation = French, currency = Francs
Test 5
Input: internationalvalue = 1000000.00, currencytype = 5, USValue = 6256100.00
Output: Display = “The value of 1000000.00 French Francs is 6256100.00 dollars”
Test Case 6
Input: currencytype = 0
Output: nation = No Country, currency =
Test 6
Input: internationalvalue = 100, currencytype = 0, USValue = 0.00
Output: Display = “Error 5: Invalid Currency Type.”
Currency Conversion Test
Test Case 1:
Input: The user selects 1 for Canadian and enters an international value of 350.00.
Output: “The value of 350.00 Canadian Dollars is 513.80 dollars”
Test Case 2:
Input: The user selects 3 for English and enters an international value of 980.00.
Output: “The value of 980.00 English Pounds is 596.33 dollars”
Test Case 3:
Input: The user selects 4 for Japanese and enters an international value of 690.00.
Output: “The value of 690.00 Japanese Yen is 72381.00 dollars”

