You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
550 B

7 years ago
  1. import java.util.*;
  2. import java.io.*;
  3. public class StockPrices
  4. {
  5. public static void main( String[] args )
  6. {
  7. double total = 0.0;
  8. Scanner inputFile = null;
  9. // Use a loop in the try block to read each line of the file.
  10. // Lecture Slides 13 (posted on D2L) provide a good example
  11. try
  12. {
  13. }
  14. catch( )
  15. {
  16. // A FileNotFoundException needs to be handled here
  17. }
  18. finally
  19. {
  20. }
  21. System.out.println( "The total value is: $" + total );
  22. }
  23. }