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, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
The footer area of a web page generally houses which website feature? terms of use web page content business name or title menu headings
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
Distinguish between a skill resume and a chronological resume and explain when it is best to use each format
Answers: 1
question
Computers and Technology, 24.06.2019 23:00
The valves of the heart and veins are similar in that they both
Answers: 1
You know the right answer?
Separating calculations into methods simplifies modifying and expanding programs. The following pro...
Questions
question
Mathematics, 13.07.2019 06:00