This commit is contained in:
2023-04-14 01:01:58 -05:00
parent 6dff1ff71c
commit 56681623cc
28 changed files with 2175 additions and 24 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,41 @@
/*
* 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));
}
}
}