# It210 Week 6 Currency Conversion

Topics: United States dollar, Pound sterling, Currency Pages: 6 (1052 words) Published: May 3, 2013
Jason Sparks April 27, 2013 IT210/ Wk 6 Conversion

Currency Conversion Procedure
Currency Conversion Test Procedure
Declare as Boolean
Set = true
While = true
Display = International Currency Conversion Program
Display = Make a Selection
Display = International Currency Types
Display = Mexican Pesos
Display = English Pounds
Display = Japanese Yen
Display = French Francs
Display = Quit
Display = Enter a Selection
Input Currency Type
If Currency Type >= 5 and Currency Type <=25 then
Set = false
Else if currency Type = 26
Display = Quitting Currency Conversion
Display = Error 4 Invalid Menu Selection
As the user is deciding which they would like to select an international currency type. When the user enters a number between 5 and 26 corresponding with a currency type, then the program is set to false. If 26 is selected the program displays “Quitting Currency Conversion.” But if the user does not enter a number between 5 and 26 the program displays “Error 4: Invalid Menu Selection” and the set it true. Test Case 1

Input: user enters 5 for Canadian Dollars
Set = false
Test Case 2
Input: user enters 6 for Mexican Pesos
Set = false
Test Case 3
Input: user enters 7 for English Pounds
Set = false
Test Case 4
Input: use enters 8 for Japanese Yen
Set = false
Test Case 5
Input: user enters 9 for French Francs
Set = false
Test Case 6
Input: user enter 10 for Quit
Set = false
Test Case 7
Input: user enters 11
Output: display “Error 4: Invalid Menu Selection”
Set = true
Get International Value
Declare value as integer
Declare set as Boolean
Set = true
While = true
Display “Enter a currency value”
Input International Value
If International Value > 0 and International Value <=1000000 Set = false
Display “Error 1: Invalid Input- Negative Number”
Set = true
End if
End while
End Get International Value
Get International Value Test Procedure
The user is most likely to enter a currency value that is a positive number. If the user enters a number that is greater than 0 and equal to or less then 1000000, set is to be false. If the user enter 0, a negative number or a number greater then 1000000, the error message “Error1: Invalid Input-Negative Number” is displayed and the set is true. Test Case 1

Input: user enters 100.00
Set = false
Test Case 2
Input: user enters 1000.00
Set = false
Test Case 3
Input: user enters 10000.00
Set = false
Test Case 4
Input: user enters 100000.00
Set = false
Test Case 5
Input: user enters 1000000.00
Set = false
Convert Currency
Declare rate as real
Select Case of Currency Type
Case 1:
Set Rate = 1.6523
Case 2:
Set Rate = 9.6248
Case 3:
Set Rate = .6294
Case 4:
Set Rate = 108.6
Case 5:
Set Rate = 4.3259
Default:
Set Rate = 0.0
End Case
US Value = rate * International Value
End Convert Currency
Convert Currency Test Procedure
If the user selects a valid currency in the Display Menu, the currency type is used to determine which case to use. The rate is set according to the currency type the user has 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.6523
Test Case 2
Input: User inputs 2
The rate is set to 9.6248
Test Case 3
Input: User inputs 3
The rate is set to .6294
Test Case 4
Input: User inputs 4
The rate is set to 108.6
Test Case 5
Input: User inputs 5
The rate is set to 4.3259
Test 1
Input: International Value = 100.00, Currency Type = 1
Output: US Value = 1.6523 * 100
US Value = 165.23
Test 2
Input: International Value = 1000.00, Currency Type = 2
Output: US Value = 9.6248 * 1000
US Value = 9624.80
Test 3
Input: International Value = 10000.00,...