Professional Documents
Culture Documents
Assignment 1
Currency Converter
Recreate Googles currency converter to switch a monetary value to another currency.
Key programming concepts: If statements, conditions, logical operators, fprintf precision
Approximate lines of code: 25 (does not include comments or white space)
Assignment 1
Sample Output
The following test cases do not cover all possible scenarios (develop your own!) but should
indicate if your code is on the right track:
Test Case 1:
MATLAB Currency Converter: 1) US Dollar 2) Euro 3) Russian Ruble
How much currency to convert? 20
Currency to convert from: 1
Currency to convert to: 2
Converted value: 18.38 Euro
Test Case 2:
MATLAB Currency Converter: 1) US Dollar 2) Euro 3) Russian Ruble
How much currency to convert? 20
Currency to convert from: 1
Currency to convert to: 3
Converted value: 1569.56 Russian Ruble
Test Case 3:
MATLAB Currency Converter: 1) US Dollar 2) Euro 3) Russian Ruble
How much currency to convert? 1000
Currency to convert from: 3
Currency to convert to: 1
Converted value: 12.74 US Dollar
Test Case 4:
MATLAB Currency Converter: 1) US Dollar 2) Euro 3) Russian Ruble
How much currency to convert? 75
Currency to convert from: 2
Currency to convert to: 3
Converted value: 6403.23 Russian Ruble
Test Case 5:
C++ Currency Converter: 1) US Dollar 2) Euro 3) Russian Ruble
How much currency to convert? 50
Currency to convert from: 2
Currency to convert to: 2
Conversion not needed...