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
3 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]3 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
The java class library interface queue method tagg retrieves the entey at the front of a queue but themrows a NosuchElementExcep
SCORPION-xisa [38]

Answer:D) peek

Explanation:Peek operation or function is the method that is used for the returning of the values on the front of the queue or stack type datatypes.               This operation function over those datatypes having group or collection of the elements and does not eliminate any element from the queue.

NOsuchElemnet exception is shown when there is the peek operation in the queue for the element to be displayed on the top and no deletion can take place .Thus, the correct option is option(D).

5 0
3 years ago
A weak fuel to air mixture along with normal airflow through a turbine engine may result in?
Sladkaya [172]

Answer:

A weak fuel to air mixture along with normal airflow through a turbine engine may result in <u>a lean die out</u>.

Explanation:

Lean die out is a type of problem that may occur in the turbine. This may result in the weak fuel to air mixture. In case if the mixture of fuel and air is getting low due to some reasons like leakage of gas or low speed of engine may result in dangerous conditions such as fire or blast in the turbine. This is called lean die out. In the result of this problem, the turbine can be burn with the blast and may leads to causalities.

5 0
3 years ago
What will be the results from running the following code?
kari74 [83]

Answer:syntax error

Explanation:

Correct on edg 2021

4 0
3 years ago
While ________ is centered on creating procedures, ________ is centered on creating objects. Procedural programming, class progr
AlexFokin [52]

Answer

Procedural programming, Object-oriented programming

Explanation

Procedural programming is a type of computer programming language that specifies a series of well structured steps and procedures  within its development period of time. It contains a systematic order of statements, functions and commands to complete a computational task or program. It is centered on creating procedures. While object oriented programming is a programming language that is centered on creating objects rather that actions and data rather than logic.. It has four principles which are inheritance, polymorphism, abstraction and Encapsulation


4 0
3 years ago
When you use a mouse to select a row or column in a table, word displays a(n) ____?
Harrizon [31]
Insert Control, I believe.
5 0
3 years ago
Other questions:
  • What is a critique of the feature detector model of object recognition?​?
    8·1 answer
  • Data warehousing and data mining mean the same thing when applied to CRM
    7·2 answers
  • Ask the user to enter the number of elements in a list of numbers. Take in the numbers from the user and then output the list th
    6·1 answer
  • What is processor, memory RAM, cDRAM,DVD RAM,video card​
    9·1 answer
  • Charles would like to visit a specific page on the World Wide Web. How should he do it? Enter the address in a search engine cli
    15·2 answers
  • (Best Buy Part A) At a Best Buy store, the forecast for the annual demand of a Motorola cell phone is 15600. Demand forecasts ar
    12·1 answer
  • Science Help
    11·1 answer
  • True or false you can add audio from flies on your own pc or record your own audio
    12·2 answers
  • What is computer software​
    9·1 answer
  • The output of a computer can be seen on ( monitor, keyboard or mouse )​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!