Java Reference
In-Depth Information
•
The format for the transaction records is a comma-delimited record of the
following fields:
Name
Required
Format
Customer Account Number
True
\d{16}
Stock Symbol
True
\w+
Quantity
True
\d+
Price
True
\d+\.\d{2}
Transaction Timestamp
True
MM\DD\YYYY
hh:mm:ss.ss
•
An transaction record looks like the following:
3276793917668488,KSS,5767,7074247,2011-04-02 07:00:08
•
All transactions will be imported as new transactions.
•
An error file will be created with any customer records that aren't valid.
•
Any transaction records that aren't valid will be written to the error file with
the customer record
Get Stocks Closing Price: A
s the batch process, at the prescheduled execution
time, I will query the Yahoo stock web service to obtain the closing prices of all
stocks held over the course of the previous month by our customers. I will build
a file with this data for future import. Acceptance criteria
•
The process will output a file each time it's run.
•
The file will consist of one record per stock symbol.
•
Each record in the file will have the following fields comma delimited:
Name
Required
Format
Stock Symbol
True
\w+
Closing Price
True
\d+\.\d{,2}
•
The file of stock quotes will be obtained from the URL
http://download.finance.yahoo.com/d/quotes.csv?s=<
QUOTES>&f=sl1
,
where
<QUOTES>
is a list of ticker symbols delimited by pluses (+) and
sl1
indicates that I want the stock ticker and the last price traded.
1