Help with assingment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gcook
    New Member
    • Apr 2008
    • 1

    Help with assingment

    Hello, I need some help!
    I need to genreate a set of test inputs and expected results for the currency conversion program below.

    I also have to use the folowing format
    Test Case <put number here>:
    Inputs: Menu Selection = <put number here>
    Expected Outputs: <put expected output here>
    Currency_Type:

    I need to include a hierarchy and flow chart

    Can some help me?

    Currency Conversion Porgram

    Main Menu
    Declare InternationalCu rrency As String
    Declare InternationalVa lue As Real
    Write “InternationalV alue”
    Write “This program computes International,”
    Write “Currency Types.”
    Call Display Menu module
    Call Get International Value module
    Call Currency Conversion Module
    Call Display Results Module
    Display_Results (Calculate)
    End Main Menu

    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 "Internatio nal 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 >= 1 AND currencyType <= 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 internationalVa lue
    if internationalVa lue > 0 AND internationValu e <= 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 = 1.6433
    case 4:
    Set rate = 104.920
    case 5:
    Set rate = 6.2561
    default:
    Set rate = 0.0
    End Case
    USValue = rate * internationalVa lue
    end While
    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 <> “” then
    Display “The value of “, internationalVa lue, “ “ , nation, “ “, currency, “ is “,
    usValue, “ dollars”
    else
    Display "Error 5: Invalid currency type."
    end if
    End Display Results
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hi gcook! Welcome to bytes.com!
    I don't recognise that language, but you should post your question in the apropriate forum.

    Greetings,
    Nepomuk

    Comment

    • Stang02GT
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      And please use CODE tags when posting code. Thanks.

      Comment

      Working...