Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Book:- Java An introdcution to problem solving and programming 7ed plz give the

ID: 3849947 • Letter: B

Question

Book:- Java An introdcution to problem solving and programming 7ed

plz give the write code in Java and make sure that the output is macthing with my prof output. The figure 8.2 ect below were found in the book.


The Assignment:

      Chapter 8:

      Programming Projects 6:  This project is found starting on page 664

Assignment Guidelines:

   

For this Programming Project, start with implementations of the Person, Student, and Undergraduate classes as depicted in Figure 8.4 and the polymorphism demo in Listing 8.6. Define the Employee, Faculty, and Staff classes as depicted in Figure 8.2. The Employee class should have instance variables to store the employee ID as an int and the employee’s department as a String. The Faculty class should have an instance variable to store the faculty member’s title (e.g. "Professor of Computer Science") as a String. The Staff class should have an instance variable to store the staff member’s pay grade (a number from 1 to 20) as an int. Every class should have appropriate constructors, accessors, and mutators, along with a writeOutput method that outputs all of the instance variable values.

Modify the program in Listing 8.6 to include at least one Faculty object and at least one Staff object in addition to the Undergraduate and Student objects. Without modification to the for loop, the report should output the name, employee ID, department, and title for the Faculty objects, and the name, employee ID, department, and pay grade for the Staff objects.

Note:

1. The solution must use the class Employee2, to distinguish it from the Employee class from Practice Program 1.

2. The project must have the following classes:

     a. person, in file person.java

     b. student, in student.java

     c. underGraduate, in underGraduate.java

     d. employee2, in file employee2.java

     e. faculty, in file faculty.java

      f. staff, in staff.java

      g. polymorphismDemo, in a file polymorphismDemo.java

Sample output:

----jGRASP exec: java PolymorphismDemo
Name: Cotty, Manny
Student Number: 4910
Student Level: 1

Name: Kick, Anita
Student Number: 9931
Student Level: 2

Name: DeBanque, Robin
Student Number: 8812

Name: Bugg, June
Student Number: 9901
Student Level: 4

Name: Mock, Kenrick
Dept: Computer Science
Employee ID: 3056
Title: Professor of Computer Science

Name: Jones, James
Dept: Mathematical Sciences
Employee ID: 1551
Pay Grade: 15

Explanation / Answer

class emp
{
public static int emp_no;
public static String name;
public static String designation;
public void showdata()
{
System.out.println("Employee number:--->"+emp_no);
System.out.println("Employee name:------>"+name);
System.out.println("Employee designation:--->"+designation);
}
}

class salary extends emp
{
public static float bsal,hr,da,tsal;
public void cal()
{
tsal=bsal+hr+da;
System.out.println("Total salary:---->"+tsal);
}
}
class empsal extends salary
{
public void calc()
{
if (bsal >=15000)
{
hr=0.3f*bsal;
da=0.2f*bsal;
}
else if (bsal >=10000)
{
hr=0.4f*bsal;
da=0.3f*bsal;
}
else
hr=0.3f*bsal+500;
da=0.2f*bsal+500;
}
public static void main(String args[])
{
empsal E=new empsal();
emp_no=Integer.parseInt(args[0]);
name=args[1];
designation=args[2];
bsal=Integer.parseInt(args[3]);
E.showdata();
System.out.println("Employee Salary");
E.calc();
E.cal();
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote