Currency Conversion

Currency Conversion

<p>Running head: CURRENCY CONVERSION 1</p><p>Currency Conversion</p><p>Billy Burger</p><p>IT-210</p><p>April 29, 2012</p><p>WALLY PISTONE CURRENCY CONVERSION 2</p><p>Currency Conversion</p><p>~Application-Level Requirements List~</p><p>1. Menu-Driven Program </p><p>2. User has option to select 1 of 5 international currency types. (Canadian dollars, Mexican pesos, English pounds, Japanese yen, and French francs)</p><p>3. Program converts foreign currency to U.S. dollars if values provided are valid.</p><p>4. Program displays the equivalent dollar amount.</p><p>5. Program returns to main menu, user has option to enter another conversion or quit the program.</p><p>~Input-Process-Output Chart~</p><p>Input Process Output</p><p>Menu Options: User selects 1 of 6</p><p>Display Menu Currency Type (Integer) 1 - 5</p><p>International Value (Real) 0 - 1,000,000</p><p>Get Foreign Value Int_Value (Real) 0 - 1,000,000</p><p>Currency Type (Integer) 1 - 5</p><p>International Value (Real) 0 - 1,000,000</p><p>Convert Currency US_Value (Real) > 0 CURRENCY CONVERSION 3</p><p>Currency Type (Integer) 1 - 5</p><p>International Value (Real) 0 - 1,000,000</p><p>US_Value (Real) > 0</p><p>Display Results Currency Type (Integer) 1 - 5</p><p>Int_Value (Real) 0 - 1,000,000</p><p>US_Value (Real) > 0</p><p>~Hierarchy Chart~</p><p>~Control Flow Diagram—Main Control~</p><p>~Control Flow Diagram—Display Menu~</p><p>~Control Flow Diagram—Get Foreign Value~ CURRENCY CONVERSION 4</p><p>~Control Flow Diagram—Convert Currency~</p><p>~Control Flow Diagram—Display Results~</p><p>~Pseudocode~</p><p>Main Control </p><p>Declare Nation As String </p><p>Write "Welcome to the Currency Conversion Program"</p><p>Write </p><p>Write "This program coverts foreign currency to US dollars."</p><p>Repeat</p><p>Call Display Menu</p><p>If Selection = 1 Then</p><p>Set Nation = Canadian CURRENCY CONVERSION 5</p><p>End If</p><p>If Selection = 2 Then</p><p>Set Nation = Mexican</p><p>End If</p><p>If Selection = 3 Then</p><p>Set Nation = English</p><p>End If</p><p>If Selection = 4 Then</p><p>Set Nation = Japanese</p><p>End If</p><p>If Selection = 5 Then</p><p>Set Nation = French</p><p>End If</p><p>Until Selection = 0</p><p>If Selection = 0 Then</p><p>Write "Thank you for using the Currency Conversion Program"</p><p>End Program</p><p>End If</p><p>Call Get Foreign Value</p><p>Call Convert Currency</p><p>Call Display Results</p><p>End Main Control</p><p>Display Menu CURRENCY CONVERSION 6</p><p>Declare Selection As Integer</p><p>Repeat</p><p>Write "Select Foreign Currency"</p><p>Write ""</p><p>Write "0 - Quit The Program"</p><p>Write "1 - Canadian Dollars"</p><p>Write "2 - Mexican Pesos"</p><p>Write "3 - English Pounds"</p><p>Write "4 - Japanese Yen" </p><p>Write "5 - French Francs"</p><p>Input Selection</p><p>If Selection = 0 Then</p><p>Repeat</p><p>Write "Are you sure you want to quit program? (Y or N)"</p><p>Input Response</p><p>If Response = N Then</p><p>Call Display Menu</p><p>If Response = Y Then</p><p>Set Selection = 0</p><p>Until Response = N or Response = Y</p><p>Else If Selection < 0 Or Selection > 5</p><p>Write "Error 4: Invalid Menu Selection"</p><p>End If</p><p>Until (Selection = Int(Selection)) And (Selection > = 0) And (Selection < = 5) CURRENCY CONVERSION 7</p><p>End Display Menu</p><p>Get Foreign Value</p><p>Declare Int_Value As Real</p><p>Repeat</p><p>Write "Enter Foreign Value"</p><p>Write "Value Must Be A Positive Number"</p><p>Input Int_Value</p><p>If Int_Value < = 0 Or > 1,000,000 Then</p><p>Write "Error 1: Invalid Input"</p><p>Write "Value Must Be A Positive Number"</p><p>Else If Int_Value < > Real</p><p>Write "Error 2: Illegal Value</p><p>Write "Value Must Be A Number"</p><p>End If</p><p>Until Int_Value > 0 And < 1,000,000</p><p>End Get Foreign Value</p><p>Convert Currency</p><p>Declare US_Value, Rate As Real</p><p>Select Case Of Nation</p><p>Case Canadian: CURRENCY CONVERSION 8</p><p>Set Rate = 1.4680</p><p>Case Mexican:</p><p>Set Rate = 9.5085</p><p>Case English:</p><p>Set Rate = 0.6085</p><p>Case Japanese:</p><p>Set Rate = 104.9200</p><p>Case French:</p><p>Set Rate = 6.2561</p><p>Default:</p><p>Set Rate = 0.0</p><p>End Case</p><p>Set US_Value = Rate * Int_Vale</p><p>End Convert Currency</p><p>Display Results</p><p>Declare Currency As String </p><p>Select Case Of Nation</p><p>Case Canadian:</p><p>Set Currency = Dollars</p><p>Case Mexican:</p><p>Set Currency = Pesos</p><p>Case English: CURRENCY CONVERSION 9</p><p>Set Currency = Pounds</p><p>Case Japanese:</p><p>Set Currency = Yen</p><p>Case French:</p><p>Set Currency = Francs</p><p>Default:</p><p>Set Currency = " "</p><p>End Case</p><p>If Currency < > " " Then</p><p>Write "The conversion for $ ", Int_Value, " ", Nation, " ", Currency</p><p>Write "is $ ", US_Value, "US Dollars."</p><p>Else</p><p>Write "Error 5: Invalid Currency Type</p><p>End If</p><p>End Display Results</p><p>~Test Case 1~</p><p>Display Menu Test: Valid Menu Selection = Canadian </p><p>Inputs: Menu Selection = 1</p><p>Expected Outputs: </p><p>Nation = Canadian</p><p>Get Foreign Value Test: Valid International Value (Canadian) = 200.00 CURRENCY CONVERSION 10</p><p>Inputs: 200.00</p><p>Expected Outputs:</p><p>Int_Value = 200.00</p><p>Convert Currency Test: Valid International Currency = Canadian</p><p>Inputs:</p><p>Nation = Canadian</p><p>Int_Value = 200.00</p><p>Expected Outputs:</p><p>US_Value = 293.60</p><p>Display Results Test Cases: Valid International Currency = Canadian</p><p>Inputs:</p><p>Nation = Canadian</p><p>Int_Value = 200.00</p><p>U.S._Value = 293.60</p><p>Expected Output:</p><p>The conversion for $ 200.00 Canadian Dollars</p><p> is $ 293.60 US Dollars.</p><p>Currency Conversion Integration Test: Valid Selection = Canadian CURRENCY CONVERSION 11</p><p>Inputs:</p><p>Nation = Canadian</p><p>Int_Value = 200.00</p><p>U.S._Value = 293.60</p><p>Expected Output</p><p>The conversion for $ 200.00 Canadian Dollars</p><p> is $ 293.60 US Dollars.</p><p>~Test Case 2~</p><p>Display Menu Test: Valid Menu Selection = Mexican </p><p>Inputs: Menu Selection = 2</p><p>Expected Outputs: </p><p>Nation = Mexican</p><p>Get Foreign Value Test: Valid International Value (Mexican) = 100.00</p><p>Inputs: 100.00</p><p>Expected Outputs:</p><p>Int_Value = 100.00</p><p>Convert Currency Test: Valid International Currency = Mexican</p><p>Inputs:</p><p>Nation = Mexican CURRENCY CONVERSION 12</p><p>Int_Value = 100.00</p><p>Expected Outputs:</p><p>US_Value = 950.85</p><p>Display Results Test Cases: Valid International Currency = Mexican</p><p>Inputs:</p><p>Nation = Mexican</p><p>Int_Value = 100.00</p><p>U.S._Value = 950.85</p><p>Expected Output:</p><p>The conversion for $ 100.00 Mexican Pesos</p><p> is $ 950.85 US Dollars.</p><p>Currency Conversion Integration Test: Valid Selection = Mexican</p><p>Inputs:</p><p>Nation = Mexican</p><p>Int_Value = 100.00</p><p>U.S._Value = 950.85</p><p>Expected Output</p><p>The conversion for $ 100.00 Mexican Pesos</p><p> is $ 950.85 US Dollars.</p><p>~Test Case 3~ CURRENCY CONVERSION 13</p><p>Display Menu Test: Valid Menu Selection = English </p><p>Inputs: Menu Selection = 3</p><p>Expected Outputs: </p><p>Nation = English</p><p>Get Foreign Value Test: Valid International Value (English) = 100.00</p><p>Inputs: 100.00</p><p>Expected Outputs:</p><p>Int_Value = 100.00</p><p>Convert Currency Test: Valid International Currency = English</p><p>Inputs:</p><p>Nation = English</p><p>Int_Value = 100.00</p><p>Expected Outputs:</p><p>US_Value = 60.85</p><p>Display Results Test Cases: Valid International Currency = English</p><p>Inputs:</p><p>Nation = English CURRENCY CONVERSION 14</p><p>Int_Value = 100.00</p><p>U.S._Value = 60.85</p><p>Expected Output:</p><p>The conversion for $ 100.00 English Pounds</p><p> is $ 60.85 US Dollars.</p><p>Currency Conversion Integration Test: Valid Selection = English</p><p>Inputs:</p><p>Nation = English</p><p>Int_Value = 100.00</p><p>U.S._Value = 60.85</p><p>Expected Output</p><p>The conversion for $ 100.00 English Pounds</p><p> is $ 60.85 US Dollars.</p><p>~Test Case 4~</p><p>Display Menu Test: Valid Menu Selection = Japanese </p><p>Inputs: Menu Selection = 4</p><p>Expected Outputs: </p><p>Nation = Japanese</p><p>Get Foreign Value Test: Valid International Value (Japanese) = 100.00 CURRENCY CONVERSION 15</p><p>Inputs: 100.00</p><p>Expected Outputs:</p><p>Int_Value = 100.00</p><p>Convert Currency Test: Valid International Currency = Japanese</p><p>Inputs:</p><p>Nation = Japanese</p><p>Int_Value = 100.00</p><p>Expected Outputs:</p><p>US_Value = 10,492.00</p><p>Display Results Test Cases: Valid International Currency = Japanese</p><p>Inputs:</p><p>Nation = Japanese</p><p>Int_Value = 100.00</p><p>U.S._Value = 10,492.00</p><p>Expected Output:</p><p>The conversion for $ 100.00 Japanese Yen</p><p> is $ 10,492.00 US Dollars.</p><p>Currency Conversion Integration Test: Valid Selection = Japanese</p><p>Inputs: CURRENCY CONVERSION 16</p><p>Nation = Japanese</p><p>Int_Value = 100.00</p><p>U.S._Value = 10,492.00</p><p>Expected Output</p><p>The conversion for $ 100.00 Japanese Yen</p><p> is $ 10,492.00 US Dollars.</p><p>~Test Case 5~</p><p>Display Menu Test: Valid Menu Selection = French </p><p>Inputs: Menu Selection = 5</p><p>Expected Outputs: </p><p>Nation = French</p><p>Get Foreign Value Test: Valid International Value (French) = 100.00</p><p>Inputs: 100.00</p><p>Expected Outputs:</p><p>Int_Value = 100.00</p><p>Convert Currency Test: Valid International Currency = French</p><p>Inputs:</p><p>Nation = French CURRENCY CONVERSION 17</p><p>Int_Value = 100.00</p><p>Expected Outputs:</p><p>US_Value = 625.61</p><p>Display Results Test Cases: Valid International Currency = French</p><p>Inputs:</p><p>Nation = French</p><p>Int_Value = 100.00</p><p>U.S._Value = 625.61</p><p>Expected Output:</p><p>The conversion for $ 100.00 French Francs</p><p> is $ 625.61 US Dollars.</p><p>Currency Conversion Integration Test: Valid Selection = French</p><p>Inputs:</p><p>Nation = French</p><p>Int_Value = 100.00</p><p>U.S._Value = </p><p>Expected Output</p><p>The conversion for $ 100.00 French Francs</p><p> is $ 625.61 US Dollars.</p><p>~Test Case 6~ CURRENCY CONVERSION 18</p><p>Display Menu Test: Valid Menu Selection = Quit The Program</p><p>Inputs: Menu Selection = 0</p><p>Expected Outputs: </p><p>Are you sure you want to quit program? (Y or N)</p><p>Inputs: Response = N</p><p>Expected Outputs:</p><p>Select Foreign Currency</p><p>0 - Quit The Program</p><p>1 - Canadian Dollars</p><p>2 - Mexican Pesos</p><p>3 - English Pounds</p><p>4 - Japanese Yen </p><p>5 - French Francs</p><p>Currency Conversion Integration Test: Valid Selection = Quit The Program</p><p>Inputs: Menu Selection = 0</p><p>Expected Outputs: </p><p>Are you sure you want to quit program? (Y or N)</p><p>Inputs: Response = N</p><p>Expected Outputs:</p><p>Select Foreign Currency CURRENCY CONVERSION 19</p><p>0 - Quit The Program</p><p>1 - Canadian Dollars</p><p>2 - Mexican Pesos</p><p>3 - English Pounds</p><p>4 - Japanese Yen</p><p>5 - French Francs</p><p>~Test Case 7~</p><p>Display Menu Test: Valid Menu Selection = Quit The Program</p><p>Inputs: Menu Selection = 0</p><p>Expected Outputs: </p><p>Are you sure you want to quit program? (Y or N)</p><p>Inputs: Response = Y</p><p>Expected Outputs:</p><p>Set Choice = 0</p><p>Thank you for using the Currency Conversion Program</p><p>End Program</p><p>Currency Conversion Integration Test: Valid Selection = Quit The Program</p><p>Inputs: Menu Selection = 0</p><p>Expected Outputs: CURRENCY CONVERSION 20</p><p>Are you sure you want to quit program? (Y or N)</p><p>Inputs: Response = Y</p><p>Expected Outputs:</p><p>Set Choice = 0</p><p>Thank you for using the Currency Conversion Program</p><p>End Program</p><p>~Test Case 8~</p><p>Display Menu Test: Invalid Menu Selection = Error </p><p>Inputs: Menu Selection = 7</p><p>Expected Outputs: </p><p>Error 4: Invalid Menu Selection</p><p>Select Foreign Currency</p><p>0 - Quit The Program</p><p>1 - Canadian Dollars</p><p>2 - Mexican Pesos</p><p>3 - English Pounds</p><p>4 - Japanese Yen</p><p>5 - French Francs</p><p>Currency Conversion Integration Test: Invalid Menu Selection = Error </p><p>Inputs: Menu Selection = 7 CURRENCY CONVERSION 21</p><p>Expected Outputs: </p><p>Error 4: Invalid Menu Selection </p><p>Select Foreign Currency</p><p>0 - Quit The Program</p><p>1 - Canadian Dollars</p><p>2 - Mexican Pesos</p><p>3 - English Pounds</p><p>4 - Japanese Yen</p><p>5 - French Francs</p><p>~Test Case 9~</p><p>Get Foreign Value Test: Invalid Foreign Value = Error</p><p>Inputs: 0</p><p>Expected Outputs: </p><p>Error 1: Invalid Input</p><p>Value Must Be A Positive Number </p><p>Enter Foreign Value</p><p>Value Must Be A Positive Number </p><p>Currency Conversion Integration Test: Invalid Foreign Value = Error</p><p>Inputs: 0 CURRENCY CONVERSION 22</p><p>Expected Outputs: </p><p>Error 1: Invalid Input</p><p>Value Must Be A Positive Number </p><p>Enter Foreign Value</p><p>Value Must Be A Positive Number </p><p>~Test Case 10~</p><p>Get Foreign Value Test: Illegal Foreign Value = Error</p><p>Inputs: Wingding</p><p>Expected Outputs: </p><p>Error 2: Illegal Value</p><p>Value Must Be A Number</p><p>Enter Foreign Value</p><p>Value Must Be A Positive Number</p><p>Currency Conversion Integration Test: Illegal Foreign Value = Error</p><p>Inputs: Wingding</p><p>Expected Outputs: </p><p>Error 2: Illegal Value</p><p>Value Must Be A Number</p><p>Enter Foreign Value</p><p>Value Must Be A Positive Number CURRENCY CONVERSION 23</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    23 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us