{double salary = 200 00; double wage = 800.00; predictRaise(400 00); predictRais
ID: 3698121 • Letter: #
Question
{double salary = 200 00; double wage = 800.00; predictRaise(400 00); predictRaise(12, 500.00); double tax = getTaxes(salary,12);} public static void predictRaise(double salary) 0{final double RAISE = 1.10; System.out println("Current salary; " + salary + "with raise: " + RAISE * SALARY);} public static void predictRaise(int months, double salary) final double RAISE = 1 +10 * months; System.out println("Current salary "+ salary + ' with month-scaled raise; + RAISE * SALARY) public static double getTaxes(double sal, int month) {return sal * (month/12) * 15;} A. Identify all the method headers. List all parameters. List the call or invoking statements. List all arguments. What is the relationship between the method on line 9 and line 13. How does the computer determine which method to execute?Explanation / Answer
A. Method headers are,
1.public static void predictRaise(double salary),
2.public static void predictRaise(int months, double salary),
3. public static Double getTaxes(double sal, int month)
B. Parameters are,
double salary,int month,int months.
C. predictRaise(400.00),
predictRaise(12, 500.00),
getTaxes(salary, 12).
D. Arguments are,
400.00,
12,
500.00
E. Method overloading relationship is in between line 9 and 13. Computer determines which method to execute is based on the arguments passing when the method is calling at main() method. If salary only is passed as argument then line 9 executes and if salary and month are passed as arguments then line 13 executes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.