COSC 071: Computer Science I

Project 3
Fall 2003

C++ implementation due: Monday, November 3rd @ 5 PM
9 points

Piggs Bank needs you to implement software for their new line of ATM machines. From the customer's bank card, the software will read the customer's name, the bank that issued the card, and the customer's four-digit PIN. From the bank's financial system, it will read the customer's checking- and savings-account balances.

The software should guide customers through the usual set of prompts. It should welcome customers, asking for and then verifying their PIN. If the PIN read from the card matches that entered at the terminal, then customers should be able to check their account balances, make withdrawals, and make deposits. If a customer uses a card from a bank other than Piggs, then there will be a transaction charge of $1.50.

Store the card information in a file named card.dta. It must consist of three lines. The first should be the card holder's name, the second, the bank's name, and the third, the card holder's 4-digit PIN. Piggs Bank issues cards with "Piggs" as the bank name.

Store the account information in a file named acct.dta. It must contain two numbers, the customer's checking-account balance and the customer's savings-account balance, in that order.

After processing the customer's transactions, the program should write the new account balances to a file named newacct.dta. Its format must be the same as that for acct.dta.

Your implementation must consist of at least four functions: for reading the card information, for reading the account information, for verifying the customer's PIN, and for writing the new account balance to the output file. Feel free to implement additional functions, if necessary.

You must use good style and formatting. You must use good variable names. You may not use global variables, but global constants are fine.

Instructions for Electronic Submission: At the top of the file containing your source code (i.e., the file containing the C++ instructions), place the following header comment, with the appropriate modifications:

//
// Project 3
// Name: <your name>
// ID: <GoCard ID>
// E-mail: <e-mail address>
// Instructor: Maloof
// TA: <TA's name>
// COSC 071
//
// In accordance with the class policies and Georgetown's Honor Code,
// I certify that, with the exceptions of the lecture notes and those
// items noted below, I have neither given nor received any assistance
// on this project.
//
// Description: <Describe your program>
//

Although you may use any C++ compiler to develop your program, it must run under UNIX and must compile using GNU g++. When you are ready to submit your program for grading, if necessary, use SSHWin to transfer your source file from your PC to gusun. Use SSHWin to logon to gusun, and use pine to e-mail it to your TA. Use your netid and the suffix ``.cc'' as the subject.

gusun% pine

When the menu appears, select the item for composing e-mail. Assume that your netid is ab123, the name of your source file is proj3.cpp, and your TA's e-mail address is ``imagoodtamaloof@cs''.

Type your TA's e-mail address in the To field, and type your netid with the .cc suffix in the Subject field (no spaces before or after). Move the cursor down into the MESSAGE TEXT screen, and type the ^R (Ctrl-R) command. Pine will ask for a file name (e.g., proj3.cpp), which it will then load as your message text. At this point, your screen should look something like the following:

Finally, type ^X (Ctrl-X) to send the e-mail to your TA.

IMPORTANT: Do not send your source code as an attachment. Do not use a mail client other than pine.

If you need to include a message to you TA about your submission, then type the message as a comment in the program.

Once you've submitted your project, it is important to keep an electronic copy on a university machine (e.g., gusun or cssun) that preserves the modification date and time. If we lose your project or the e-mail system breaks, then we will need to look at the modification date and time of your project to ensure that you submitted it before it was due.

The TAs who will be grading your projects this semester are listed on the main page. You must e-mail your project before 5 PM on the due date.