subject

Separating calculations into methods simplifies modifying and expanding programs. The following program calculates the tax rate and tax to pay, using methods. One method returns a tax rate based on an annual salary.
Run the program below with annual salaries of 40000, 60000, and 0.
Change the program to use a method to input the annual salary.
Run the program again with the same annual salaries as above. Are results the same?
This is the code including what I am working on added. I will not run. I need to remove some areas to designate the scanner as the source of input but I am unsure of which area.
import java. util. Scanner;
public class IncomeTax {
// Method to get a value from one table based on a range in the other table
public static double (int search, int [] baseTable, double [] valueTable) {
int baseTableLength = baseTable. length;
double value = 0.0;
int i = 0;
boolean keepLooking = true;
i = 0;
while ((i < baseTableLength) && keepLooking) {
if (search <= baseTable[i]) {
value = valueTable[i];
keepLooking = false;
}
else {
++i;
}
}
return value;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Which of the following is not a “fatal four” event?
Answers: 2
question
Computers and Technology, 24.06.2019 18:00
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
If the average computer chip had 1,200 transistors per square inch in 1970, approximately how many transistors per square inch would one have in 1976? use moore's law to calculate your answer
Answers: 1
You know the right answer?
Separating calculations into methods simplifies modifying and expanding programs. The following pro...
Questions
question
Mathematics, 25.11.2021 14:10
Questions on the website: 13722363