//------------// Introduction to Programming Using Java: An Object-Oriented Approach//	Arnow/Weiss//------------// the total loop// Chapter 9, Section 9.5, Page 333// MODIFICATIONS://    We have placed the loop in a main method and provided a BufferedReader//    in a variable named br//    We have changed the signature of readIn so that it receives a BufferedReaderimport java.io.*;public class Demo_total {	public static void main(String[] a) throws Exception {		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));		////////////////////////////////////////////////////////////////////		int totalPay;	// totalPay== the total paid out so far.		int count;	// count== the number of employees processed so far.		Employee emp;	// emp refers to the most recently read Employee object.		int hours;	// hours== the number of hours worked by the				//      most recently read employee.		count = 0;		totalPay = 0;		emp = Employee.readIn(br);		// All Employee objects created prior to the one emp refers to have been processed.		while (emp!=null) {			System.out.print("Enter hours for ");			System.out.print(emp.getName());			System.out.print(": ");			hours = Integer.parseInt(br.readLine());			count++;			int  pay = emp.calcPay(hours);			System.out.println(pay);			totalPay += pay;			emp = Employee.readIn(br);		}		System.out.print("Total payout: ");		System.out.println(totalPay);		////////////////////////////////////////////////////////////////////	}}// Here is some sample input for this program:// Wallabee// 15// 40// Fox// 18// 40// Hawkins// 8// 25// The following is minimal version of an Employee class// suitable for demonstrating the above loop. Normally// it would be in a separate file, but is included in this// file for the sake of convenience.class Employee {	Employee(String name, int pay) {		this.name = name;		this.pay = pay;	}	static Employee readIn(BufferedReader br) throws Exception {		String n = br.readLine();		if (n==null)			return null;		String p = br.readLine();		if (p==null)			return null;		return new Employee(n,Integer.parseInt(p));	}	String getName() { return name;}	int calcPay(int hours) { return hours*pay; }	private	String	name;	private	int	pay;}