LoadList should contain no hard-coded values. You will need to set a delimiter for the scanner as discussed in the FAQ file. TestList should consist of only a main method with no instance variables or meth ods.
LoadList should contain no hard-coded values. You will need to set a delimiter for the scanner as discussed in the FAQ file. TestList should consist of only a main method with no instance variables or meth ods.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
LoadList should contain no hard-coded values. You will need to set a delimiter for the scanner as discussed in the FAQ file. TestList should consist of only a main method with no instance variables or meth ods.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
+loadList(fileName:String):int Opens the file fileName and reads all the
StockTrades into the list. fileName is the complete path and file name. loadList should contain no hard-coded values. You will need to set a delimiter for the scanner as discussed in the FAQ file. Use this: s.useDelimiter(", |\n|\r\n|\f")
public int loadList(String fileName)throw FileNotFoundException{
TestList should consist of only a main method with no instance variables or meth ods. In TestList.main, you should do the following: 1. Instantiate a TradeArrayList object called eyeTrade 2. Invoke eyeTrade.loadList to load the file of StockTrades. You should catch the FileNotFoundException and print the message returned by it instead of advertising that your main may throw this exception. 3. Using a for loop, print the elements 2630 to 2640 of your array, one per line , in the format returned by StockTrade.toString. 4. Print the following StockTrades in the same format (and in the order below!). a. HSE-T, Mar-15-2000 b. HSE-T, Mar-22-2000 c. BCE-T, Dec-15-2006 Make sure to read the FAQ file posted on the website regularly
public void static main () {
try { TradeArrayList eyeTrade = new TradeArrayList; eyeTrade.loadList(Filename); for (int i = 2630 ; i >= 2640 ; i++){ eyeTrade.trade[i].toString();