Question
Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two individual for
Your program is going to compare the distinct salaries of two individuals for the last 5
years. If the salary for the two individual for a particular year is exactly the same, you should print an
error and make the user enter both the salaries again for that year. (The condition is that there salaries
should not be the exact same).
Your program should accept from the user the salaries for each individual one year at a time.
When the user is finished entering the salaries, the program should print which individual made the
highest total salary over the 5 year period. This is the individual whose salary is the highest.
You have to use arrays and loops in this assignment.
In the sample output examples, what the user entered is shown in italics.
Welcome to the winning card program.
Enter the salary individual 1 got in year 1
>10000
Enter the salary individual 2 got in year 1
>50000
Enter the salary individual 1 got in year 2
>30000
Enter the salary individual 2 got in year 2
>50000
Enter the salary individual 1 got in year 3
>35000
Enter the salary individual 2 got in year 3
>105000
Enter the salary individual 1 got in year 4
>85000
Enter the salary individual 2 got in year 4
>68000
Enter the salary individual 1 got in year 5
>75000
Enter the salary individual 2 got in year 5
>100000
Individual 2 has the highest salary.
java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import javautilScanner public class SalaryComparison public static void mainString args Scanner scan...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started