Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Display a menu of 3 options, one for calling each of the methods you will define. Option 1 calls method 2, option 2 calls

image text in transcribed

java

Display a menu of 3 options, one for calling each of the methods you will define. Option 1 calls method 2, option 2 calls method 3, and option 3 calls method 4. Program must run in a continuous loop. Steps: Results of calling individual methods are displayed in the main method. a) Method 1: A void method to display a menu of choices b) Method 2: An int method to return the factorial of its integer parameter. If the method's parameter value is larger than 10, return-1. This method does NOT display any output. It just returns a value. The factorial of a number is the product of the numbers between 1 and the number. In your main method, if the factorial of the number cannot be computed, issue a message such as "factorial of your number cannot be calculated". You will use the returned value (-1 for invalid value) of the method to issue the error message. c) Method 3: A double method that accepts employee's ID number, first name, last name, regular and overtime hours worked and the hourly pay rate for an employee. The method calculates and returns the employee's gross pay. Note that overtime pay is 1.0 times the regular pay, if the employee worked more than 30 hours. So, if: o Regular hours 30 o Overtime hours 5 o Pay rate $15 o Gross pay 30*15 (5 15 1.0) $525 d) Method 4: A string method accepts as parameters, 2 Strings. The method returns 100 if the 2 strings are equal. It returns-100 if the first string is greater than the second string and it returns 1000 if the first string is less than the second string. e) Method 5: A double method that accepts 2 integer values and calculate and return the sum of values between the parameters, with steps of 1. You need a loop to calculate the sum of these values. Inside the method, decide if the calculated sum is more than 100. If so, have the method return 1. Sample: 1. Find factorial 2. Emp. salary 3. Two Strings 4. Calculate sums

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

Students also viewed these Databases questions