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

Part II (0 Points) Programming Question In a software development company, there

ID: 3580442 • Letter: P

Question

Part II (0 Points) Programming Question In a software development company, there are 2 types of employees: programmers and testers. Employee is an abstract class that represents the notion ofan employee. This class has an abstract method worko which will be defined later in the Programmer and Tester class. The Employee class framework is given to you below: public abstract class Employee private String nane Private int id: Public Employee //to be developed in your program public abstract int work public string tostring return name ID: id: Programmer class is a subclass of Employee class. There is an instance variable modules writtenPerDay, which represents the average number of modules of code this programmer can produce. Of course there is a fluctuation depending on the difficulty level of the code s/he is writing. The Programmer class's work0 returns the number of modules he wrote on a given day. which is a random number between 50% and 150% of his average. Tester class is a subclass of Employee class. A tester can, on the average, test a given number of modules of code per day, captured by an instance variable modulesTestedPerDay. The Tester class's work() returns the number of lines he tested on a given day, which is a number between 75% and 125% of his average. Project class that models a software development project. should have at least the following fields: numModules number of modules to be written (a number that is higher than modules writtenPerDay and modulesTestedPerDay) one programmer one tester Make sure the constructor of the Programmer class and Tester class use the constructor of the Employee class. write tostring0 methods for these 2 subclasses that use the Employee's toString() method.

Explanation / Answer

import java.util.Scanner;

public abstact class Employee //base class

{

private string name;

private int id;

public employee(string name,int id)

{

this.name=name;

this.id=id;

}

public abstract int work();

public string tostring()

{

return name+"ID"+id;

}

}

class programmer extends Employee //sub class1

{

int NoOfModules;

string s2;

public int work()

{

return NoOfModules;

}

public void display(int x,int y,NoOfModule)

{

super(name,id);

this.NoOfModules=NoOfModules;

s2=super.tostring();

System.out.println("No OF Modules is Testing is:"+NoOfModules_Testing);

}

}

public Tester extends Employee //sub class2

{

int NoOfModules_Testing;

public void display1()

{

super(name,id);

this.NoOfModules_Testing=NoOfModules_Testing;

s2=super.tostring();

System.out.println("No OF Modules is:"+NoOfModules_Testing);

}

public int work()

{

return NoOfModules_Testing;

}

}

class project

{

public static void main(String[] args)

{

Scanner sc=new Scanner(System.in);

programmer ModulesWrittenPerDay=new  ModulesWrittenPerDay();

tester TesterPerDay=new TesterPerDay();

System.out.println("Enter your ID");   
int ID=sc.nextInt();   
System.out.println("Enter your name");   
String NAME=sc.next();   
System.out.println("Enter modules per day");   
int days=sc.nextInt();

ModulesWrittenPerDay.dispaly(ID,NAME,days);

int j=ModulesWrittenPerDay.work();

System.out.println("the modules written by the employee"+j);

System.out.println("Enter modules tested per day");   
int days1=sc.nextInt();

if(days>days1)

{

TesterPerDay.display1(ID,NAME,days1);

int k=TestedPerDay.work();

System.out.println("the modules Tested by the Tester"+k);

}

else

{

System.out.println("The no of written modules should be higher than no.of tested modules");

}

}

}

thank you

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