Answer:
Check the explanation
Explanation:
1. After running the program for annual salary 40000 and 50000 and then enter 0
a) For annual salaries of 40000
taxRate will be . 20
taxToPay will be 40000 x .20 = 8000
b)For annual salaries of 50000
taxRate will be . 30
taxToPay will be 50000 x .30 = 15000
2. Modify the program to use two parallel arrays named annualSalaries and taxesToPay
a) For implementing array of anuualSalaries that take input from user, refer following given code:
Scanner s=new Scanner(System.in);
System.out.println("enter number of anuualSalaries");
int n=s.nextInt();
int anuualSalaries[]=new int[n];
System.out.println("enter anuualSalaries");
for(int i=0;i<n;i++){//for reading array
anuualSalaries[i]=s.nextInt();
b) For implementing array of taxestoPay refer following code
int taxestoPay[] = new int[anuualSalaries.length];
for (int i = 0; i < taxestoPay.length; i++) {
taxestoPay[i] = "enter the result value of tax to pay"
}
4. For two dimensional array of salariesAndTaxes refer following given code
int[][] salariesAndTaxes = new int[2][];
salariesAndTaxes[0] = new int[10];
salariesAndTaxes[1] = new int[10];