473,395 Members | 1,418 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help with assingment

1
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 InternationalCurrency As String
Declare InternationalValue As Real
Write “InternationalValue”
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 "International 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 internationalValue
if internationalValue > 0 AND internationValue <= 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 * internationalValue
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 “, internationalValue, “ “ , nation, “ “, currency, “ is “,
usValue, “ dollars”
else
Display "Error 5: Invalid currency type."
end if
End Display Results
Apr 17 '08 #1
2 1456
Nepomuk
3,112 Expert 2GB
Hi gcook! Welcome to bytes.com!
I don't recognise that language, but you should post your question in the apropriate forum.

Greetings,
Nepomuk
Apr 23 '08 #2
Stang02GT
1,208 Expert 1GB
And please use CODE tags when posting code. Thanks.
Apr 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
7
by: Snake | last post by:
Hi guys, I have question about classes. when u create class called Test. and you define variable Test c; so does this act like( a variable c of type Test pointing to an abject )? The thing that...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
7
by: McCarthy | last post by:
My assingment is to write a command line program in Unix. This program takes 3 arguments. The third argument is a generation prefix. I am suppose to print out to a text file in the format of ...
3
by: hjast | last post by:
I am doing an assingment for class and I have everything execpt it will not compile. I get these errors /Users/hjast89/Desktop/test/shape.cpp:36: error: expected `}' at end of input...
1
by: Kburge03 | last post by:
Hi!! I've been working on this assingment for class where I have to design and implement an application that displays two Die objects, a button, and a label. Every time the button is pushed, the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.