Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SummerTest {
- public static void main(String[] args) {
- SummerStats test = new SummerStats(10,10);
- System.out.println("Index of Highest Earner: " + test.getHighestEarner());
- System.out.println("Year with highest earned Salary :" + test.getHighestEarningYear());
- System.out.println("Total amount of money made by person #5: " + test.getHighestEarnings(5));
- System.out.println("Total earnings over all years: " + test.getAllEarnings());
- System.out.println("Total earnings of person in year #5 " + test.getMaxEarningsInYear(5));
- System.out.println("Average earnings in each year :" );
- double [] avgSal = test.averageSalary();
- for(int i = 0; i < avgSal.length;i++)
- {
- System.out.printf("Year #: %d [%3.2f]\n",(i+1),avgSal[i]);
- }
- double temp[][] = test.getSortedEarnings();
- System.out.println("Sorted Earnings: ");
- for(int i = 0; i < temp.length;i++)
- {
- for(int j = 0; j < temp.length;j++)
- {
- System.out.printf("|%3.2f|",temp[i][j]);
- if(j%9 == 0 && j > 0)
- {
- System.out.println("\tPerson #" + (i+1));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement