Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I wrote this in paeudocode and I need help translating it to java please Class Employee Private Real payRate Private Real hoursWorked Private Real

Please I wrote this in paeudocode and I need help translating it to java please
Class Employee
Private Real payRate
Private Real hoursWorked
Private Real grossPay
Public Module Employee ( )
Set payRate = 0.0
Set hoursWorked = 0.0
Set grossPay = 0.0
End Module
Public Function Real getPayRate ( )
Return payRate
End Function
Public Function Real getHoursWorked ( )
Return hoursWorked
End Function
Public Function Real getGrossPay ( )
Return grossPay
End Function
Public Module setPayRate (Real newPayRate)
If newPayRate > 0 Then
Set payRate = newPayRate
Else
Display newPayRate, " is not a valid pay rate."
Set payRate = 0
End If
End Module
Public Module setHoursWorked (Real newHoursWorked)
If newHoursWorked > 0 Then
Set hoursWorked = newHoursWorked
Else
Display newHoursWorked, " is not a valid value for hours worked."
Set hoursWorked = 0
End If
End Module
Public Module computeGrossPay ( )
Set grossPay = payRate * hoursWorked
Display "Gross pay is", grossPay
End Module
End Class

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

Distinguish between private and public sector organization.

Answered: 1 week ago