Question

public class EmployeeDriver public static void main(String[] args) 1/declare create an Employee object named joo. Une no-arg
0 0
Add a comment Improve this question Transcribed image text
Answer #1
public class EmployeeDriver {

    public static void main(String[] args) {
        Employee joe = new Employee();

        joe.setName("Joe Cool");
        joe.setId("E111111");
        joe.setHoursWorked(20);
        joe.setPayRate(15);

        Employee jane = new Employee("Jane Doe", "E001122", 10.50);

        jane.setHoursWorked(40);

        jane.setPayRate(12.00);

        System.out.println(joe.getName() + ", with id " + joe.getId() + ", worked " + joe.getHoursWorked() + " hours at $" + joe.getPayRate() + " an hour.");
        System.out.println(jane.getName() + ", with id " + jane.getId() + ", worked " + jane.getHoursWorked() + " hours at $" + jane.getPayRate() + " an hour.");

        System.out.println("Wage of " + joe.getName() + " is $" + joe.calcWages());
        System.out.println("Wage of " + jane.getName() + " is $" + jane.calcWages());

        if (joe.calcWages() == jane.calcWages()) {
            System.out.println("same");
        } else {
            System.out.println("not same");
        }
    }
}

Joe Cool, with id E111111, worked 20.0 hours at $15.0 an hour. Jane Doe, with id E001122, worked 40.0 hours at $12.0 an hour.

Please upvote

Add a comment
Know the answer?
Add Answer to:
public class EmployeeDriver public static void main(String[] args) 1/declare create an Employee object named joo. Une...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Correct the mistakes public class customer { public static void main(String[] args) { D customer=new d();...

    Correct the mistakes public class customer { public static void main(String[] args) { D customer=new d(); d.employee(56,”ali”); d.department(7,8.6,9); } public void employee(String name, int age) { System.out.println("Your name is"+name); System.out.println(“Age is”+age); } public int department(double d, double t, int a) { System.out.println("I have java exam at 3:00"); Return(1.1); } } V. PROGRAMMING. Write a complete JAVA program to implement the following. 1. Create a class named Exponent. Its main() method accepts an integer value from a user at the keyboard,...

  • Create a Java file named Ch6Asg.java that contains a public class named Ch6Asg containing a main()...

    Create a Java file named Ch6Asg.java that contains a public class named Ch6Asg containing a main() method. Within the same file, create another class named Employee, and do not declare it public. Create a field for each of the following pieces of information: employee name, employee number, hourly pay rate, and overtime rate. Create accessor and mutator methods for each field. The mutator method for the hourly pay rate should require the value to be greater than zero. If it...

  • Create a C# Console program. Add a class named Employee that has the following public fields:...

    Create a C# Console program. Add a class named Employee that has the following public fields: • Name. The name field references a String object that holds the employee’s name. • IDNumber. The IDNumber is an int that holds the employee’s ID number. • Department. The department field is a String that holds the name of the department where the employee works. • Position. The position field is a String that holds the employee’s job title. Once you have written...

  • Suppose you were given the job to write a Java class to manage employee payroll information...

    Suppose you were given the job to write a Java class to manage employee payroll information in an HR management system. Each employee will be modeled as a single EmployeePayroll object (much like the Student objects discussed in class). The state of the EmployeePayroll object includes the first name and last name of the employee, a unique 15 digit employee number for each employee, a number of hours that they've worked this week (which could be a fraction of an...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • Create a class Employee. Your Employee class should include the following attributes: First name (string) Last...

    Create a class Employee. Your Employee class should include the following attributes: First name (string) Last name (string) Employee id (string) Employee home street address (string) Employee home city (string) Employee home state (string) Write a constructor to initialize the above Employee attributes. Create another class HourlyEmployee that inherits from the Employee class. HourEmployee must use the inherited parent class variables and add in HourlyRate and HoursWorked. Your HourEmployee class should contain a constructor that calls the constructor from the...

  • Write a C++ program Write a class named Employee that has the following member variables: name...

    Write a C++ program Write a class named Employee that has the following member variables: name A string that holds the employee name idNumber An int to hold employee id number department A string to hold the name of the department position A string to hold the job position The class will have three constructors: 1. A constructor that accepts all the internal data such as: Employee susan("Susan Meyers", 47899, "Accounting", "Vice President"); 2. A constructor that accepts some of...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • Create another Java class named EmployeeMain within the same project, which includes the main method. a....

    Create another Java class named EmployeeMain within the same project, which includes the main method. a. Include another class named Employee in the same Java file. This class has the following instance variables and instance methods. Define all the instance/static variables with private access modifier and constructors, instance/static methods with public access modifier. Instance Variables empID: int employeeName: String basicSalary: double Constructor Set the value for empID. Instance Methods Get and set methods for all instance variables. displayEmployee: Display the...

  • please debug this code: import java.util.Scanner; import edhesive.shapes.*; public class U2_L7_Activity_Three{ public static void main(String[] args){...

    please debug this code: import java.util.Scanner; import edhesive.shapes.*; public class U2_L7_Activity_Three{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); double radius; double length; System.out.println("Enter radius:"); double r = scan.nextDouble(); System.out.println("Enter length:"); double l = scan.nextDouble(); System.out.println("Enter sides:"); int s = scan.nextInt(); Circle c = Circle(radius); p = RegularPolygon(l , s); System.out.println(c); System.out.println(p); } } Instructions Debug the code provided in the starter file so it does the following: • creates two Double objects named radius and length creates...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT