import java.util.*;
import java.io.*;
public class Employee_pay_increases
{
public static void main(String[] args)
throws FileNotFoundException
{
String employeeOne, employeeTwo, employeeThree, e1FirstName, e1LastName, e2FirstName, e2LastName, e3FirstName, e3LastName,
e1Salary, e2Salary, e3Salary, e1FinalSal, e2FinalSal, e3FinalSal, e1Increase, e2Increase, e3Increase, outPut;
double employee1Sal, employee2Sal, employee3Sal, employee1Final, employee2Final, employee3Final, employee1Increase, employee2Increase, employee3Increase;
Scanner inFile = new Scanner( new FileReader("C:\\Ch3_Ex7Data.txt"));
employeeOne = inFile.nextLine();
employeeTwo = inFile.nextLine();
employeeThree = inFile.nextLine();
e1LastName = employeeOne.substring(0, 6);
e1FirstName = employeeOne.substring(7, 13);
e1Salary = employeeOne.substring(14, 22);
e1Increase = employeeOne.substring(23, 24);
//System.out.println(employeeOne);
//System.out.println(e1FirstName);
//System.out.println(e1LastName);
//System.out.println(e1Salary);
//System.out.println(e1Increase);
e2LastName = employeeTwo.substring(0, 5);
e2FirstName = employeeTwo.substring(6, 12);
e2Salary = employeeTwo.substring(13, 21);
e2Increase = employeeTwo.substring(22,23);
e3LastName = employeeThree.substring(0, 5);
e3FirstName = employeeThree.substring(6, 10);
e3Salary = employeeThree.substring(11, 19);
e3Increase = employeeThree.substring(20, 23);
employee1Sal = Double.parseDouble(e1Salary);
employee1Increase = Double.parseDouble(e1Increase);
employee1Final = employee1Sal * (employee1Increase / 100);
employee2Sal = Double.parseDouble(e2Salary);
employee2Increase = Double.parseDouble(e2Increase);
employee2Final = employee2Sal * (employee2Increase / 100);
employee3Sal = Double.parseDouble(e3Salary);
employee3Increase = Double.parseDouble(e3Increase);
employee3Final = employee3Sal * (employee3Increase / 100);
PrintWriter outFile = new PrintWriter("C:\\users\\remo\\downloads\\Ch3_Ex7Output.txt");
outPut = e1FirstName + " " + e1LastName + " " + String.format("%.2f", employee1Final) + "\n" +
e2FirstName + " " + e2LastName + " " + String.format("%.2f", employee2Final) + "\n" +
e3FirstName + " " + e3LastName + " " + String.format("%.2f", employee3Final) + "\n";
System.out.printf(outPut);
outFile.printf(outPut);
inFile.close();
outFile.close();
}
}