The Question

Write a java program called Q1.java. It should read in lines from standard input (until there are no more lines). Each line will be of the form

name#number#limit

where name is the name of a credit card holder, number is the number used to create the card-number string and limit is the initial credit limit. This information should be used to create a credit card using the appropriate 3 argument constructor. Duplicate cards should be allowed.

After all input lines have been read and all cards created, your program should output a short dashed line ("----------") to visually separate output from input and then print out the cards in the reverse order to that to that in which they were created. See the sample output below.

The output should conform to that in the sample run of a correct program shown below. Note that, in this sample run, the % sign is not part of the program output.

Sample Run

%
% java Q1
Enter credit card information, one card per line:
William Shatner#123456#10000.00
William Burton#234567#999.99
Robert Redford#345678#888.88
Robert Duval#456789#777.77
----------
CARD [NO=456789-6, BALANCE=0.00]
CARD [NO=345678-3, BALANCE=0.00]
CARD [NO=234567-0, BALANCE=0.00]
CARD [NO=123456-6, BALANCE=0.00]
%

Useful APIs

Here (again) are the common APIs that you may access:

Java 1.5 API
Type API

Submitting Your Work

Here is the command to submit your work (further details regarding the submit command can also be obtained by typing man submit
Once again, you are encouraged to submit regularly. Newer submissions overwrite older ones.

submit 1020 labtest3W7 Q1.java