Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that implements the following features: Write Java functions performs the following steps: getHourlyRate() Prompt the user for an hourly pay rate

Write a Java program that implements the following features:

  1. Write Java functions performs the following steps:
    1. getHourlyRate()
      1. Prompt the user for an hourly pay rate
      2. If the hourly pay rate is less than zero or greater than 50 then return a value of negative 1
      3. If the hourly pay rate is greater than zero and less than or equal to 50 return the pay rate
    2. getWorkedHours()
      1. Pass this function the hourly pay rate which was retrieved from the getHourlyRate()
      2. Prompt the user for the hours worked
      3. If the hours worked is less than zero or greater than 100 then return -1
      4. If the hours worked are 40 or less than multiply the hourly rate by the hours worked and return the value
      5. If the hours worked are greater than 40 then compute the base pay by multiplying 40 by the hourly rate and multiplying the hours over 40 by 1.5 times the hourly rate
      6. Return the total pay

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions