The program needs to create a transaction file

The POS program will record credit card sales in a file called transactions . txt. At the end of each day, this file is sent to the bank and any money is transferred from the credit card account into the health club's bank account.

The bank has sent an example version of the file for you to see what sort of data you will need to generate:

The first 16 characters are The next 7 characters The desCriptions follow. the credit card number. ^ are the price. ^

The first 16 characters are The next 7 characters The desCriptions follow. the credit card number. ^ are the price. ^

The file contains formatted data. There's a line of text (or record) for each item sold. The first 16 characters of the line are the credit card number, followed by 7 characters that represent the sale price, excluding the decimal point (so $1.75 is written as 0000175). The rest of the record is a description of the item being sold.

How would you create a string of characters in the correct format for the record? Which parts of the record will be the hardest to create?

string formats

Was this article helpful?

0 0

Post a comment