The goal of this programming assignment is to give students experience creating an interactive program that uses nested conditional statements. In particular, your task is to write a menu-based program that enables to user to calculate how much their money is worth in another currency.
Typically, an interactive currency conversion program will ask the user three questions: 1) what currency they are starting with, 2) what currency they want to convert to, and 3) how much money they want to convert. There are literally hundreds of currencies in the world, so to keep things simple, your program only needs to convert the US Dollar to and from FIVE other currencies that YOU get to choose. This means that your program must be able to handle 2x5=10 possible currency conversions.
Once you have chosen your five currencies, you need to look up their current exchange rates and store these values in constants in your program. For example, 10 minutes ago the exchange rate of the US Dollar on the www.xe.com website was:
Using this information, your program should print a menu of conversion options to the screen, and then process the user input to perform the actual currency conversion. For example if the user chooses to convert $100.00 USD to CAD, your program should print $109.91 CAD as the converted amount. If the user types in an invalid menu choice, or they type in an invalid currency amount, your program should print an error message and exit.
For this assignment, the first design task is to decide what type of currency conversion you are going to implement (USD to other currency or the reverse). Then you need to decide what messages you are going to print to the screen and what input data to read from the user. Once you have the user inputs, your final task is to design the sequence of conditions and calculations needed to perform the actual currency conversion.
Finally, you need to output the results in a format that is easily understood by the user. In most cases, currency values are printed with two decimal digits (eg. $109.91 CAD above) but in some cases they are printed with zero decimal digits (eg. Japanese Yen). You should decide what is appropriate for the currencies in your program.
Since you are starting with a "blank piece of paper" to implement this project, it is very important to develop your code incrementally writing comments, adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" even if it is not complete.
Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Try your program with several input values, and save your testing output in text files for inclusion in your project report.
When you have completed your C++ program, write a short report using the project report template describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Save this report to be submitted electronically.
In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic analysis of all programs that are submitted.
Rename your program and documentation files 123456789.hw2.cpp and 123456789.hw2.docx using your UAID number in place of 123456789, and go the Blackboard site for this class and submit these two files.
The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit:
This course will be using highly effective program comparison software to calculate the similarity of all programs to each other, and to homework assignments from previous semesters. Please do not be tempted to plagiarize from another student.
Violations of the policies above will be reported to the Provost's office and may result in a ZERO on the programming project, an F in the class, or suspension from the university, depending on the severity of the violation and any history of prior violations.