/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package quizapr12; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * * @author jcmtiernan */ public class QuizApr12 { /** * @param args the command line arguments */ public static void main(String[] args) { //Quiz Apr 12 //Write a declaration and initialization for a 2 dimensional array to hold floating point data (like money) //There should be 10 rows and five columns of data. final int ROW = 5; int COL = 5; double[][] money = new double[ROW][COL]; double[] easymoney = new double[50]; //Declare a scanner to attach to a file named "Expenses.txt" File inFile = new File("Expenses.txt"); Scanner input = new Scanner(System.in); boolean flag = true; try { input = new Scanner(inFile); // really needs a try-catch } catch (FileNotFoundException fnf) { System.out.println(fnf); flag = false; // does not handle invalid data from the keyboard } //Read in 50 money values from the file and store them in the array. /* for (int i=0; i<50;i++) { easymoney[i]=input.nextDouble(); }*/ if (flag) { for (int i=0; i