1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Maslowich
2 years ago
8

The below program uses an array salaryBase to hold the cutoffs for each salary level and a parallel array taxBase that has the c

orresponding tax rate. Run the program and enter annual salaries of 40000 and 60000, then enter 0. Modify the program to use two parallel arrays named annualSalaries and taxesToPay, each with 10 elements. Array annualSalaries holds up to 10 annual salaries entered; array taxesToPay holds up to 10 corresponding amounts of taxes to pay for those annual salaries. Print the total annual salaries and taxes to pay after all input has been processed. Run the program again with the same annual salary numbers as above. Challenge: Modify the program from the previous step to use a 2-dimensional array of 10 elements named salariesAndTaxes instead of two one-dimensional parallel arrays. The 2D array's first column will hold the salaries, the second the taxes to pay for each salary. "java"
Computers and Technology
1 answer:
marissa [1.9K]2 years ago
5 0

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];

You might be interested in
C:/Users/Documents/resume.docx Where is the "resume" document located in this file structure?
ASHA 777 [7]

Answer:

"resume.docx" is located in "Documents"

Explanation:

[<drive-letter:: represents drive name>]:/Main_Directory/Sub_Directory/ETC..

3 0
2 years ago
Which function can you perform on a word processor but not on a typewriter?
zmey [24]
A function you can perform on a word processor BUT NOT on a typewriter is editing.
5 0
3 years ago
Read 2 more answers
The rod and crankshaft convert the up-and-down motion of the piston into
OLEGan [10]
Yes and that is correct
7 0
3 years ago
Read 2 more answers
Kyla, a business analyst uses test scripts while testing an application before it is released to the client. Why do business ana
Mariana [72]

Answer:

D. to create a test environment

Explanation:

After releasing it will be "production"

8 0
3 years ago
You have a scenario where you need to disable the guest network on your wireless router. You try to log in, but your password do
Tom [10]

Answer:

Reset the router by holding down the reset button for 30 seconds. The reset button can be located in the back or bottom area of the router. The function of the reset button is to turn restore the wireless router to default factory setting such that customized settings including the DNS, the static IP address setup, stored personal passwords DHCP parameter settings port forwarding and routing settings are erased.

Explanation:

8 0
3 years ago
Other questions:
  • To instruct Oracle11 g to sort data in ascending order, enter ____ after the column name in the ORDER BY clause.
    15·2 answers
  • To change the background color of a page, which tab would you use?
    15·2 answers
  • Given 3 floating-point numbers. Use a string formatting expression with conversion specifiers to output their average and their
    14·1 answer
  • Which Google Analytics visualization compares report data to the website average?A. Pivot viewB. Comparison viewC. Performance v
    8·1 answer
  • Options to open,save,and print a document are found on which of the following tabs? A.File B.Home C. Design D. Layout
    5·2 answers
  • Write a SELECT statement that uses an aggregate window function to get the total amount of each order. Return these columns: The
    13·1 answer
  • Translation of a file into a coded Format that occupies less space than the original file is called
    6·1 answer
  • 1. Distinguish between
    7·1 answer
  • In this project you will write a set of instructions (algorithm). The two grids below have colored boxes in different
    9·2 answers
  • After a Hacker has selects her target, performed reconnaissance on the potential target's network, and probed active Internet Ad
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!