Create the logic for a program that computes weekly salary.
Include two overloaded methods named computeWeeklySalary(). One version accepts and annual salary as a number and calculates weekly salary as 1/52 of the annual amount. The other accepts a number of hours worked per week and an hourly pay rate and calculates weekly salary as a product of the two. Each returns the weekly salary to the calling program. The main program prompts the user for the type of calculation to perform, and based on the user’s response, prompts for appropriate data, calls the correct method, and displays the result.
Tags: