CSCE 2004 - Homework 2
Due Date - Sept 19, 2014 at 11:59 PM

1. Problem Statement:

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:

1 USD US Dollar
0.77537 EUR Euro
0.62119 GBP British Pound
1.09912 CAD Canadian Dollar
1.08085 AUD Australian Dollar
106.200 JPY Japanese Yen

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.

2. Design:

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.

3. Implementation:

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.

4. Testing:

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.

5. Documentation:

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.

6. Project Submission:

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:

You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended.

7. Academic Honesty Statement:

  • Students are expected to submit their own work on all programming projects, unless group projects have been explicitly assigned.
  • Students are NOT allowed to distribute code to each other, or copy code from another individual or website.
  • Students ARE allowed to use any materials on the class website, or in the textbook, or ask the instructor and/or GTAs for assistance.
  • 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.