App.java
//App.java -- Takes in a input of 3 employees, payrates, and hours worked.
// Calulates the employee's pay with consideration of overtime.
//CSIS 212-B01
//Citations **
//** Formatting decimal points -- https://stackoverflow.com/questions/42334771/double-with-
exactly-two-decimal-digits-in-java-without-java-text-decimalfomat */
package main;
import java.util.Scanner;
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Bradley Bentow - Assignment #2 \n");
//Variable declaration
Employee employee;
Scanner input = null;
int EmployeeIterator = 1;
double hoursWorked;
double employeePayRate;
//Properly using a Try finally to prevent a memory leak of Scanner.
, try
{
//Instantiate Scanner before the while loop.
input = new Scanner(System.in);
do {
//Take in the Employee's pay rate, store as a double
System.out.print("Employee's hourly pay rate: ");
employeePayRate = input.nextDouble();
//Take in the Employee's working hours, store as a double
System.out.print("Hours the employee worked: ");
hoursWorked = input.nextDouble();
//Instantiate a new Employee object and pass in the pay rate and hours worked,
//The class is abstracted and will automatically make the total pay available
//with employee.EmployeeTotal
employee = new Employee(hoursWorked, employeePayRate);
//Now that everything is completed, we can show the user the completed string with
//the wanted calculations.
System.out.printf("Pay for Employee %d is: $%.2f\n", EmployeeIterator,
employee.EmployeeTotal);
//Add one to the iterator so the loop doesn't run forever.
EmployeeIterator += 1;