Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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) 1 // TODO code application logic here ] public static double predictRaise(double salary)X double newAmount; double bonusAmount; final double RAISE = 1.10; newAmount = salary * RAISE; bonusAmount = calculateBonus(newAmount); newAmount = newAmount + bonusAmount; retum newAmount; 1 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago