It 210 Final: Currency Conversion Essay

~Application-Level Requirements List~ 1. Menu-Driven Program 2. User has option to select 1 of 5 international currency types. (Canadian dollars, Mexican pesos, English pounds, Japanese yen, and French francs) 3. Program converts foreign currency to U. S. dollars if values provided are valid. 4. Program displays the equivalent dollar amount. 5. Program returns to main menu, user has option to enter another conversion or quit the program. ~Input-Process-Output Chart~ InputProcessOutput Menu Options: User selects 1 of 6 Display MenuCurrency Type (Integer) 1 – 5 International Value (Real) 0 – 1,000,000

Get Foreign ValueInt_Value (Real) 0 – 1,000,000 Currency Type (Integer) 1 – 5 International Value (Real) 0 – 1,000,000 Convert CurrencyUS_Value (Real) > 0 Currency Type (Integer) 1 – 5 International Value (Real) 0 – 1,000,000 US_Value (Real) > 0 Display ResultsCurrency Type (Integer) 1 – 5 Int_Value (Real) 0 – 1,000,000 US_Value (Real) > 0 ~Hierarchy Chart~ ~Control Flow Diagram—Main Control~ ~Control Flow Diagram—Display Menu~ ~Control Flow Diagram—Get Foreign Value~ ~Control Flow Diagram—Convert Currency~ ~Control Flow Diagram—Display Results~ ? ~Pseudocode~ Main Control Declare Nation As String

We will write a custom essay sample on
It 210 Final: Currency Conversion Essay
or any similar topic only for you
Order now

Write “Welcome to the Currency Conversion Program” Write Write “This program coverts foreign currency to US dollars. ” Repeat Call Display Menu If Selection = 1 Then Set Nation = Canadian End If If Selection = 2 Then Set Nation = Mexican End If If Selection = 3 Then Set Nation = English End If If Selection = 4 Then Set Nation = Japanese End If If Selection = 5 Then Set Nation = French End If Until Selection = 0 If Selection = 0 Then Write “Thank you for using the Currency Conversion Program” End Program End If Call Get Foreign Value Call Convert Currency Call Display Results End Main Control Display Menu Declare Selection As Integer

Repeat Write “Select Foreign Currency” Write “” Write “0 – Quit The Program” Write “1 – Canadian Dollars” Write “2 – Mexican Pesos” Write “3 – English Pounds” Write “4 – Japanese Yen” Write “5 – French Francs” Input Selection If Selection = 0 Then Repeat Write “Are you sure you want to quit program? (Y or N)” Input Response If Response = N Then Call Display Menu If Response = Y Then Set Selection = 0 Until Response = N or Response = Y Else If Selection < 0 Or Selection > 5 Write “Error 4: Invalid Menu Selection” End If Until (Selection = Int(Selection)) And (Selection > = 0) And (Selection < = 5)

End Display Menu Get Foreign Value Declare Int_Value As Real Repeat Write “Enter Foreign Value” Write “Value Must Be A Positive Number” Input Int_Value If Int_Value < = 0 Or > 1,000,000 Then Write “Error 1: Invalid Input” Write “Value Must Be A Positive Number” Else If Int_Value < > Real Write “Error 2: Illegal Value Write “Value Must Be A Number” End If Until Int_Value > 0 And < 1,000,000 End Get Foreign Value Convert Currency Declare US_Value, Rate As Real Select Case Of Nation Case Canadian: Set Rate = 1. 4680 Case Mexican: Set Rate = 9. 5085 Case English: Set Rate = 0. 6085 Case Japanese:

Set Rate = 104. 9200 Case French: Set Rate = 6. 2561 Default: Set Rate = 0. 0 End Case Set US_Value = Rate * Int_Vale End Convert Currency Display Results Declare Currency As String Select Case Of Nation Case Canadian: Set Currency = Dollars Case Mexican: Set Currency = Pesos Case English: Set Currency = Pounds Case Japanese: Set Currency = Yen Case French: Set Currency = Francs Default: Set Currency = ” ” End Case If Currency < > ” ” Then Write “The conversion for $ “, Int_Value, ” “, Nation, ” “, Currency Write “is $ “, US_Value, “US Dollars. ” Else Write “Error 5: Invalid Currency Type End If End Display Results Test Case 1~ Display Menu Test: Valid Menu Selection = Canadian Inputs: Menu Selection = 1 Expected Outputs: Nation = Canadian Get Foreign Value Test: Valid International Value (Canadian) = 200. 00 Inputs: 200. 00 Expected Outputs: Int_Value = 200. 00 Convert Currency Test: Valid International Currency = Canadian Inputs: Nation = Canadian Int_Value = 200. 00 Expected Outputs: US_Value = 293. 60 Display Results Test Cases: Valid International Currency = Canadian Inputs: Nation = Canadian Int_Value = 200. 00 U. S. _Value = 293. 60 Expected Output: The conversion for $ 200. 00 Canadian Dollars is $ 293. 60 US Dollars.

Currency Conversion Integration Test: Valid Selection = Canadian Inputs: Nation = Canadian Int_Value = 200. 00 U. S. _Value = 293. 60 Expected Output The conversion for $ 200. 00 Canadian Dollars is $ 293. 60 US Dollars. ~Test Case 2~ Display Menu Test: Valid Menu Selection = Mexican Inputs: Menu Selection = 2 Expected Outputs: Nation = Mexican Get Foreign Value Test: Valid International Value (Mexican) = 100. 00 Inputs: 100. 00 Expected Outputs: Int_Value = 100. 00 Convert Currency Test: Valid International Currency = Mexican Inputs: Nation = Mexican Int_Value = 100. 00 Expected Outputs: US_Value = 950. 85

Display Results Test Cases: Valid International Currency = Mexican Inputs: Nation = Mexican Int_Value = 100. 00 U. S. _Value = 950. 85 Expected Output: The conversion for $ 100. 00 Mexican Pesos is $ 950. 85 US Dollars. Currency Conversion Integration Test: Valid Selection = Mexican Inputs: Nation = Mexican Int_Value = 100. 00 U. S. _Value = 950. 85 Expected Output The conversion for $ 100. 00 Mexican Pesos is $ 950. 85 US Dollars. ~Test Case 3~ Display Menu Test: Valid Menu Selection = English Inputs: Menu Selection = 3 Expected Outputs: Nation = English Get Foreign Value Test: Valid International Value (English) = 100. 0 Inputs: 100. 00 Expected Outputs: Int_Value = 100. 00 Convert Currency Test: Valid International Currency = English Inputs: Nation = English Int_Value = 100. 00 Expected Outputs: US_Value = 60. 85 Display Results Test Cases: Valid International Currency = English Inputs: Nation = English Int_Value = 100. 00 U. S. _Value = 60. 85 Expected Output: The conversion for $ 100. 00 English Pounds is $ 60. 85 US Dollars. Currency Conversion Integration Test: Valid Selection = English Inputs: Nation = English Int_Value = 100. 00 U. S. _Value = 60. 85 Expected Output The conversion for $ 100. 00 English Pounds is $ 60. 5 US Dollars. ~Test Case 4~ Display Menu Test: Valid Menu Selection = Japanese Inputs: Menu Selection = 4 Expected Outputs: Nation = Japanese Get Foreign Value Test: Valid International Value (Japanese) = 100. 00 Inputs: 100. 00 Expected Outputs: Int_Value = 100. 00 Convert Currency Test: Valid International Currency = Japanese Inputs: Nation = Japanese Int_Value = 100. 00 Expected Outputs: US_Value = 10,492. 00 Display Results Test Cases: Valid International Currency = Japanese Inputs: Nation = Japanese Int_Value = 100. 00 U. S. _Value = 10,492. 00 Expected Output: The conversion for $ 100. 00 Japanese Yen s $ 10,492. 00 US Dollars. Currency Conversion Integration Test: Valid Selection = Japanese Inputs: Nation = Japanese Int_Value = 100. 00 U. S. _Value = 10,492. 00 Expected Output The conversion for $ 100. 00 Japanese Yen is $ 10,492. 00 US Dollars. ~Test Case 5~ Display Menu Test: Valid Menu Selection = French Inputs: Menu Selection = 5 Expected Outputs: Nation = French Get Foreign Value Test: Valid International Value (French) = 100. 00 Inputs: 100. 00 Expected Outputs: Int_Value = 100. 00 Convert Currency Test: Valid International Currency = French Inputs: Nation = French Int_Value = 100. 00 Expected Outputs:

US_Value = 625. 61 Display Results Test Cases: Valid International Currency = French Inputs: Nation = French Int_Value = 100. 00 U. S. _Value = 625. 61 Expected Output: The conversion for $ 100. 00 French Francs is $ 625. 61 US Dollars. Currency Conversion Integration Test: Valid Selection = French Inputs: Nation = French Int_Value = 100. 00 U. S. _Value = Expected Output The conversion for $ 100. 00 French Francs is $ 625. 61 US Dollars. ~Test Case 6~ Display Menu Test: Valid Menu Selection = Quit The Program Inputs: Menu Selection = 0 Expected Outputs: Are you sure you want to quit program? (Y or N)

Inputs: Response = N Expected Outputs: Select Foreign Currency 0 – Quit The Program 1 – Canadian Dollars 2 – Mexican Pesos 3 – English Pounds 4 – Japanese Yen 5 – French Francs Currency Conversion Integration Test: Valid Selection = Quit The Program Inputs: Menu Selection = 0 Expected Outputs: Are you sure you want to quit program? (Y or N) Inputs: Response = N Expected Outputs: Select Foreign Currency 0 – Quit The Program 1 – Canadian Dollars 2 – Mexican Pesos 3 – English Pounds 4 – Japanese Yen 5 – French Francs ~Test Case 7~ Display Menu Test: Valid Menu Selection = Quit The Program Inputs: Menu Selection = 0

Expected Outputs: Are you sure you want to quit program? (Y or N) Inputs: Response = Y Expected Outputs: Set Choice = 0 Thank you for using the Currency Conversion Program End Program Currency Conversion Integration Test: Valid Selection = Quit The Program Inputs: Menu Selection = 0 Expected Outputs: Are you sure you want to quit program? (Y or N) Inputs: Response = Y Expected Outputs: Set Choice = 0 Thank you for using the Currency Conversion Program End Program ~Test Case 8~ Display Menu Test: Invalid Menu Selection = Error Inputs: Menu Selection = 7 Expected Outputs: Error 4: Invalid Menu Selection

Select Foreign Currency 0 – Quit The Program 1 – Canadian Dollars 2 – Mexican Pesos 3 – English Pounds 4 – Japanese Yen 5 – French Francs Currency Conversion Integration Test: Invalid Menu Selection = Error Inputs: Menu Selection = 7 Expected Outputs: Error 4: Invalid Menu Selection Select Foreign Currency 0 – Quit The Program 1 – Canadian Dollars 2 – Mexican Pesos 3 – English Pounds 4 – Japanese Yen 5 – French Francs ~Test Case 9~ Get Foreign Value Test: Invalid Foreign Value = Error Inputs: 0 Expected Outputs: Error 1: Invalid Input Value Must Be A Positive Number Enter Foreign Value Value Must Be A Positive Number

Currency Conversion Integration Test: Invalid Foreign Value = Error Inputs: 0 Expected Outputs: Error 1: Invalid Input Value Must Be A Positive Number Enter Foreign Value Value Must Be A Positive Number ~Test Case 10~ Get Foreign Value Test: Illegal Foreign Value = Error Inputs: Wingding Expected Outputs: Error 2: Illegal Value Value Must Be A Number Enter Foreign Value Value Must Be A Positive Number Currency Conversion Integration Test: Illegal Foreign Value = Error Inputs: Wingding Expected Outputs: Error 2: Illegal Value Value Must Be A Number Enter Foreign Value Value Must Be A Positive Number

×

Hi there, would you like to get such a paper? How about receiving a customized one? Check it out