CSCE 2004 - Programming Assignment 1
Due: Wednesday, Feb 2, 2011 at 11:59pm

1. Problem Statement:

The goal of this programming assignment is to develop an interactive program for converting currency from dollars (USD) to South Korean won (KRW) and vice versa (KRW to USD). For the purposes of this assignment, the exchange rate of 1 KRW = 0.0009 USD should be used. At the beginning, the program should print out your name and uark ID number. The user should then be prompted with a statement asking whether they want to convert from KRW to USD or USD to KRW. (Make sure to tell the user of your program what these acronyms mean!) Once the conversion method is selected the user should then be prompted to enter a value to be converted. This converted value should then be printed onto the screen.

The program should also do some basic error checking to make sure the user enters appropriate values when prompted. Specifically, if the user enters a negative number an error message should be displayed and the program should end. (Note that there are MANY possible errors; you do not need to catch every possibility.)

After your program is fully functioning, perform one final step: Run your program, and select to convert from USD to KRW. Then, choose a "medium" value to convert; say, $1000. Now, re-run your program, taking the same steps, except choose a larger value; say, $10000. Repeat this process until you get an output that doesn't make sense.

In comments at the top of your source code file, say what value gave an odd output. Then, give an explanation for why you believe you got the output you did.

2. Design:

Looking at the requirements above, try to sketch out the "flow" of the program using either a diagram or a sequence of conditional statements written in pseudo-code. Mentally walk through each of the possible paths, and think about what conditions and calculations need to be performed. Once you have done this, work out the basic formulas you will use to convert from Won to Dollars and from Dollars to Won and test these on paper, with a calculator, or with a spreadsheet to verify they are correct.

3. Implementation:

Start your program with comments based on your design and (the following cannot be emphasized enough..) add portions of code a little at a time. Compile and run your program on a regular basis, so you always have something that runs, even if it only does part of the job. Make sure you have completed the first task, e.g., printing your name to the screen, before you start writing code for the second task.

4. Testing and Debugging:

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. For debugging purposes, it is useful to "echo" any variables you input, and to print intermediate results as they are calculated.

You should comment out your debugging code before you hand in your final version of the program.

5. Documentation:

When you have completed your C++ program, write a short report (less than half of a page long; a few sentences will suffice) 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?

Include this report in the comments at the top of your source code file.

6. Project Submission:

NOTE: In the future, we will use Turing's PC2 submission system to submit homework assignemnts. For homework 1, we will do something different...

To Submit Homework 1:

  1. Begin an email to your TA with the title "CSCE 2004 HW1".
  2. Copy/paste the contents of your source code file into the body of the email.

    (Note: Do not add anything extra to the body of the email! And make sure your FULL name and uark ID number are printed out at the beginning of your program...)

  3. Send the email!

The date/time-stamp on your email will be used to verify that you met the due date above. All late projects will receive reduced credit (10% off if less than 24 hours late, no credit if more than 24 hours late), so hand in your best effort on the due date.