Difference between revisions of "Currency Converter"
Line 2: | Line 2: | ||
|Problem= | |Problem= | ||
− | This program will convert dollar amounts | + | This program will convert dollar amounts from Canadian to US dollars, and vice versa. There will be three input dialog boxes, implemented using JOptionPane.showInputDialog. The first input will ask the user for the currency to which they would like to convert, either CAD or USD. The next input asks for the current conversion rate to the desired currency, and the final input asks for the dollar amount to be converted. The program will then display a dialog box with the dollar amounts in both the original currency and the converted amount in the new currency. |
+ | <br><br> | ||
+ | This program will require nesting of if statements and loops within one another, and there should be some input checking to ensure that inputs are valid and that all dollar amounts are greater than or equal to zero. | ||
Revision as of 02:04, 6 April 2010
Back to the Program-A-Day homepage
ProblemThis program will convert dollar amounts from Canadian to US dollars, and vice versa. There will be three input dialog boxes, implemented using JOptionPane.showInputDialog. The first input will ask the user for the currency to which they would like to convert, either CAD or USD. The next input asks for the current conversion rate to the desired currency, and the final input asks for the dollar amount to be converted. The program will then display a dialog box with the dollar amounts in both the original currency and the converted amount in the new currency.
|
SideSectionTitle
An image or By Students section | |
---|---|---|
SolutionThe solution... | ||
CodeSolutionCode goes here. Please DO NOT put your code in <pre> tags! |