Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EmployeeLastNameFirstName {
- public String name;
- public String emailAddress;
- public int hoursWorked;
- public double rate;
- public EmployeeLastNameFirstName(String name, String emailAddress, int hoursWorked, double rate){
- this.name = name;
- this.emailAddress = emailAddress;
- this.hoursWorked = hoursWorked;
- this.rate = rate;
- }
- public void setName(String neym){
- this.name = neym;
- }
- public void setEmailAddress(String email){
- this.emailAddress = email;
- }
- public void setHoursWorked(int hrs){
- this.hoursWorked = hrs;
- }
- public void setRatePH(double rph){
- this.rate = rph;
- }
- public String getName(){
- return this.name;
- }
- public String getEmailAddress(){
- return this.emailAddress;
- }
- public int getHoursWorked(){
- return this.hoursWorked;
- }
- public double getRate(){
- return this.rate;
- }
- public double getWage(){
- return this.rate * this.hoursWorked;
- }
- public static void main(String[] args) {
- EmployeeLastNameFirstName employee = new EmployeeLastNameFirstName("Samson Angel", "[email protected]", 40, 725.50);
- System.out.println("Name: " + employee.name);
- System.out.println("Email: " + employee.emailAddress);
- System.out.println("Rate: " + employee.rate);
- System.out.println("Number of Hours Worked: " + employee.hoursWorked);
- System.out.println("Wage: " + employee.getWage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment