Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started