Question: programming (Information and Communication Technology) NPRG62120 Tutorial 1 The code below demonstrate method chaining where one method calls another method within its' method body. These

 programming (Information and Communication Technology) NPRG62120 Tutorial 1 The code below

programming (Information and Communication Technology)

NPRG62120 Tutorial 1 The code below demonstrate method chaining where one method calls another method within its' method body. These methods have not been executed, thus you are required to amend and execute these methods in the main method. Inn executing these methods, you are required to do the follow: - Prompt the user for the salary (5) - Only execute one method that will run both methods (4) - Include comments in the lines of code that are highlighted in red. Explain what the line of code is meant to do. (6) - Explain how the program will execute, that is, the step-by-step on how the program will execute until the results are displayed. (10) //You can write this in bullet format public class chainedMethods \{ public static void main (String[] args) \{ // TODO code application logic here \} public static double predictRaise(double salary)\{ double newAmount; double bonusAmount; final double RAISE = 1.10; newAmount = salary RAISE; bonusAmount = calculateBonus(newAmount); newAmount = newAmount + bonusAmount; return newAmount; \} public static double calculateBonus(double salary) \{ final double BONUS_AMT =50.00; salary = salary + BONUS_AMT; return salary; \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!