@@ -62,7 +62,7 @@ public static void main(String[] args) throws FileNotFoundException {
6262 * symbols and 0.0 shares.
6363 *
6464 * @param stocks
65- * the available stock tickers, e.g. AAPL
65+ * the available stock tickers, e.g. AAPL
6666 * @return the standard portfolio setup
6767 */
6868 public static double [] setupPortfolio (String [] stocks ) {
@@ -80,13 +80,13 @@ public static double[] setupPortfolio(String[] stocks) {
8080 * Calculates the amount of shares from the budget / price.
8181 *
8282 * @param stocks
83- * the available stock tickers, e.g. AAPL
83+ * the available stock tickers, e.g. AAPL
8484 * @param prices
85- * the buying price of one of all the given stocks
85+ * the buying price of one of all the given stocks
8686 * @param portfolio
87- * the amount of stock owned by the owner of the portfolio
87+ * the amount of stock owned by the owner of the portfolio
8888 * @param input
89- * user input scanner
89+ * user input scanner
9090 * @return true if buying was successful and false if not
9191 */
9292 private static boolean buyingSimulation (String [] stocks , double [] prices , double [] portfolio ,
@@ -124,11 +124,11 @@ private static boolean buyingSimulation(String[] stocks, double[] prices, double
124124 * Sells the user provided amount of shares of a stock.
125125 *
126126 * @param stocks
127- * the available stock tickers, e.g. AAPL
127+ * the available stock tickers, e.g. AAPL
128128 * @param portfolio
129- * the amount of stock owned by the owner of the portfolio
129+ * the amount of stock owned by the owner of the portfolio
130130 * @param input
131- * user input scanner
131+ * user input scanner
132132 * @return true if selling was successful and false if not
133133 */
134134 private static boolean sellingSimulation (String [] stocks , double [] portfolio , Scanner input ) {
@@ -157,9 +157,9 @@ private static boolean sellingSimulation(String[] stocks, double[] portfolio, Sc
157157 * Displays the current state of the portfolio without showing 0.0 values.
158158 *
159159 * @param stocks
160- * the available stock tickers, e.g. AAPL
160+ * the available stock tickers, e.g. AAPL
161161 * @param portfolio
162- * the amount of stock owned by the owner of the portfolio
162+ * the amount of stock owned by the owner of the portfolio
163163 */
164164 private static void displaySimulation (String [] stocks , double [] portfolio ) {
165165 System .out .println ();
@@ -175,13 +175,13 @@ private static void displaySimulation(String[] stocks, double[] portfolio) {
175175 * Saves the current state of the portfolio to a file specified by the user.
176176 *
177177 * @param stocks
178- * the available stock tickers, e.g. AAPL
178+ * the available stock tickers, e.g. AAPL
179179 * @param portfolio
180- * the amount of stock owned by the owner of the portfolio
180+ * the amount of stock owned by the owner of the portfolio
181181 * @param input
182- * scanner object to read users file name
182+ * scanner object to read users file name
183183 * @throws FileNotFoundException
184- * when user inputted file is not found
184+ * when user inputted file is not found
185185 */
186186 private static void saveSimulation (String [] stocks , double [] portfolio , Scanner input )
187187 throws FileNotFoundException {
@@ -203,10 +203,10 @@ private static void saveSimulation(String[] stocks, double[] portfolio, Scanner
203203 * Loads the symbols from a TSV file.
204204 *
205205 * @param filename
206- * the name of the file to fetch the stock symbols from
206+ * the name of the file to fetch the stock symbols from
207207 * @return an array of strings representing the stock symbols
208208 * @throws FileNotFoundException
209- * when user inputted file is not found
209+ * when user inputted file is not found
210210 */
211211 public static String [] getSymbolsFromFile (String filename ) throws FileNotFoundException {
212212 Scanner fileScan = new Scanner (new File (filename ));
@@ -232,10 +232,10 @@ public static String[] getSymbolsFromFile(String filename) throws FileNotFoundEx
232232 * Loads the prices from the TSV file.
233233 *
234234 * @param filename
235- * the name of the file to fetch the stock symbols from
235+ * the name of the file to fetch the stock symbols from
236236 * @return an array of strings representing the stock prices
237237 * @throws FileNotFoundException
238- * when user inputted file is not found
238+ * when user inputted file is not found
239239 */
240240 public static double [] getPricesFromFile (String filename ) throws FileNotFoundException {
241241 Scanner fileScan = new Scanner (new File (filename ));
@@ -261,9 +261,9 @@ public static double[] getPricesFromFile(String filename) throws FileNotFoundExc
261261 * Finds the index of a symbol in the given symbols array.
262262 *
263263 * @param stocks
264- * the available stock tickers, e.g. AAPL
264+ * the available stock tickers, e.g. AAPL
265265 * @param symbol
266- * stock ticker, e.g. AAPL
266+ * stock ticker, e.g. AAPL
267267 * @return the index of the stock symbol in the stocks array
268268 */
269269 public static int findSymbolIndex (String [] stocks , String symbol ) {
@@ -279,13 +279,13 @@ public static int findSymbolIndex(String[] stocks, String symbol) {
279279 * Add shares to the portfolio.
280280 *
281281 * @param stocks
282- * the available stock tickers, e.g. AAPL
282+ * the available stock tickers, e.g. AAPL
283283 * @param portfolio
284- * the amount of stock owned by the owner of the portfolio
284+ * the amount of stock owned by the owner of the portfolio
285285 * @param symbol
286- * stock ticker, e.g. AAPL
286+ * stock ticker, e.g. AAPL
287287 * @param shares
288- * amount of the shares of stock bought
288+ * amount of the shares of stock bought
289289 * @return true if succeeded and false if not
290290 */
291291 public static boolean addSharesToPortfolio (String [] stocks , double [] portfolio , String symbol ,
@@ -303,13 +303,13 @@ public static boolean addSharesToPortfolio(String[] stocks, double[] portfolio,
303303 * Subtract shares from the portfolio.
304304 *
305305 * @param stocks
306- * the available stock tickers, e.g. AAPL
306+ * the available stock tickers, e.g. AAPL
307307 * @param portfolio
308- * the amount of stock owned by the owner of the portfolio
308+ * the amount of stock owned by the owner of the portfolio
309309 * @param symbol
310- * stock ticker, e.g. AAPL
310+ * stock ticker, e.g. AAPL
311311 * @param sharesToSell
312- * amount of shares of stock to be sold
312+ * amount of shares of stock to be sold
313313 * @return true if succeeded and false if not
314314 */
315315 public static boolean subtractSharesFromPortfolio (String [] stocks , double [] portfolio ,
@@ -333,9 +333,9 @@ public static boolean subtractSharesFromPortfolio(String[] stocks, double[] port
333333 * converting them to dollars and adding them up
334334 *
335335 * @param prices
336- * the buying price of one of all the given stocks
336+ * the buying price of one of all the given stocks
337337 * @param portfolio
338- * the amount of stock owned by the owner of the portfolio
338+ * the amount of stock owned by the owner of the portfolio
339339 * @return valuation of portfolio based on its owned shares
340340 */
341341 public static double getPortfolioValuation (double [] prices , double [] portfolio ) {
@@ -356,11 +356,11 @@ public static double getPortfolioValuation(double[] prices, double[] portfolio)
356356 * Gets the price of a stock from its symbol.
357357 *
358358 * @param stocks
359- * the available stock tickers, e.g. AAPL
359+ * the available stock tickers, e.g. AAPL
360360 * @param prices
361- * the buying price of one of all the given stocks
361+ * the buying price of one of all the given stocks
362362 * @param symbol
363- * stock ticker, e.g. AAPL
363+ * stock ticker, e.g. AAPL
364364 * @return the price of stock given its symbol
365365 */
366366 public static double getPrice (String [] stocks , double [] prices , String symbol ) {
0 commit comments