/home/caleb/ASDV-Java/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/Large.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.mp5_calebfontenot;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author caleb
 */
public class Large {
    public static void main(String[] args) {
        // Read data file
        // ArrayLists
        ArrayList firstNameArr = new ArrayList();
        ArrayList lastNameArr = new ArrayList();
        ArrayList jobTitleArr = new ArrayList();
        ArrayList salaryArr = new ArrayList();
        
        File file = new File("Salary.txt");
        try (Scanner fileScanner = new Scanner(file)) {
            while (fileScanner.hasNext()) {
                firstNameArr.add(fileScanner.next());
                lastNameArr.add(fileScanner.next());
                jobTitleArr.add(fileScanner.next());
                salaryArr.add(fileScanner.next());
                fileScanner.nextLine(); // consume newline
            }
        } catch (Exception ex) {
            System.out.println("Unable to read file");
        }
        for (int i = 0; i < firstNameArr.size(); ++i) {
            System.out.println("first name :" + firstNameArr.get(i));
            System.out.println("last name: " + lastNameArr.get(i));
            System.out.println("job title: " + jobTitleArr.get(i));
            System.out.println("salary: " + salaryArr.get(i));
            System.out.println("--------------------------------------");
        }
    }
}