Closed Thread
Results 1 to 2 of 2

Thread: Test inputs help please.

  1. #1
    patience Guest

    Test inputs help please.

    Hi,

    I need some input on an assignment I am doing. I am not sure if I even did this assignment right or not. So any help would be appreciated.

    My assignment is to generate a test input based on the Currency Conversion program.


    International currency type

    • Canadian dollars (rate: 1 U.S. dollar = 1.4680 Canadian dollars)
    • Mexican Peso (rate: 1 U.S. dollar = 9.5085 pesos)
    • English Pounds (rate: 1.6433 dollars = 1 pound)
    • Japanese Yen (rate: 1 U.S. dollar = 104.9200 yen)
    • French francs (rate: 1 U.S. dollar = 6.2561 francs)



    Here is my Test inputs based on the currency above.


    1. Input 146.8 Canadian dollars and the result should come out as 100 U.S.
    dollars.

    2. Input 950.85 and the result should be 100 US dollars also

    3. Input 100 pounds and the result should be 164.33 US dollars.

    4. Input 10492 yen and the result should be 100 US dollars.

    5. Input 625.61 francs and the result should also be 100 US dollars.


    • To check that the calculations are correct, I would also need to input 0 and 2,100,000 to see if the error message works. It should say, “Error invalid amount”.
    • I would input a 6 in the choose currency type and it should display, “Exiting conversion program.
    • For the last part I would enter 7 in the choose currency type and it should display, “Error: Invalid amount”.



    Main Module

    Declare currency amount as integer
    Declare currencytype as integer
    Declare Othercountryvalue as real
    Declare USAValue as real
    Do While user continues
    Display menu
    Get Othercountryvalue
    Convert currency
    Display results
    End loop
    Print exit message

    End Main Module

    Display Menu

    Set continue = true
    While continue = true
    Display “Welcome to the foreign currency conversion program”
    Display “Choose a currency to convert”
    Display “Foreign 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 program”
    Display “Choose a currency type”

    Input currencytype
    If currencytype >= 1 and currencytype <= 5 then
    Set continue = false
    else if currencytype = 6
    Display “Exiting conversion program”
    Continue = false
    Else
    Display “Error: This choice does not exist”
    Continue = true
    end if
    end while

    End Display Menu

    Get Othercountryvalue

    Declare value as integer
    Declare continue as real
    Set continue = true
    While continue = true
    Display “Enter currency amount:”
    Input othercountryvalue
    If othercountryvalue > 0 and othercountryvalue <= 2000000 then
    Continue = false
    else
    Display “Error: Invalid amount”
    Continue = true
    end if
    end while

    End get othercountryvalue

  2. CODECALL Circuit advertisement

     
  3. #2
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    You might want to test that the inputed values are integers not letters. I know in Java the program will terminate if the program is expecting an integer and gets passed a letter.

    And if you want to have a look, this is what I came up with for a GUI based Java Currency Conversion program. need help on class project

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating inputs onfly and database saving
    By Ficoder in forum PHP Development
    Replies: 0
    Last Post: 02-14-2011, 07:16 AM
  2. Replies: 2
    Last Post: 08-28-2009, 07:30 PM
  3. Pascal program that inputs an integer larger than 1
    By sobi in forum Pascal and Delphi
    Replies: 7
    Last Post: 05-01-2009, 04:49 PM
  4. Help with Command Line inputs
    By Sh4d0ws in forum Java Help
    Replies: 2
    Last Post: 02-16-2009, 06:55 PM
  5. Forms, Inputs and Variables :-/
    By beastilio in forum HTML Programming
    Replies: 7
    Last Post: 01-04-2008, 05:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts