answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergeu [11.5K]
2 years ago
14

Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named depart

ment, of type String. Supply a method toString that prints the manager’s name, department, and salary. Make a class Executive inherit from Manager. Supply appropriate toString & equals methods for all classes. Supply a test program that tests these classes and methods.
Computers and Technology
1 answer:
sweet [91]2 years ago
8 0

Answer:

see explaination

Explanation:

class Employee

{

String name;

double salary;

void tostring()

{

System.out.println("Employee:\nName: "+name+"\nSalary: "+salary+"\n");

}

Employee(String n,double s)

{

name=n;

salary=s;

}

}

class Manager extends Employee

{

String department;

void tostring()

{

System.out.println("Manager:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Manager(String n,double s,String d)

{

super(n,s);

department=d;

}

}

class Executive extends Manager

{

void tostring()

{

System.out.println("Executive:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Executive(String n,double s,String d)

{

super(n,s,d);

}

}

public class test

{

public static void main(String args[])

{

Employee e =new Employee("Neo",12000);

e.tostring();

Manager m =new Manager("Cramster",100000,"Homework");

m.tostring();

Executive ex =new Executive("Chuks",1000000,"Homework");

ex.tostring();

}

}

You might be interested in
The height of a small rocket y can be calculated as a function of time after blastoff with the following piecewise function: y 5
SOVA2 [1]

Answer:

High level Language

understand

Explanation:

rocket is 0...4433456u888

5 0
1 year ago
You are given an array x of string elements along with an int variable n that contains the number of elements in the array. You
Slav-nsk [51]

Answer:

The code to this question can be given as:

Code:

int i,j,count_previous=0,count_next=0; //define variable

for (j=0; j<n; j++) //loop for array

{

if (x[0]==x[j]) //check condition

{

count_previous++; //increment value by 1.

}

}

for (i=0; i<n; i++) //loop

{

for (j=0; j<n; j++)

{

if (x[i]==x[j]) //check condition

{

count_next++; //increment value by 1.

}

}

if (count_previous>count_next) //check condition

{

mode=x[i-1];

}

else

{

mode=x[i];

count_previous=count_next; //change value.

count_next= 0 ; //assign value.

}

}

Explanation:

In the question it is define that x is array of the string elements that is already define in the question so the code for perform operation in the array is given above. In the code firstly we define the variable that is i, j, count_previous, count_next. The variable i,j is used in the loop and variable count_previous and count_next we assign value 0 that is used for check the values of array. Then we define the for loop in this loop we use conditional statement in the if block we check that array of zero element is equal to array of j value then the count_previous is increase by 1. Then we use nested loop It is also known as loop in a loop. In this first loop is used for array and the second loop is used for check array element.In this we use the condition that if array x of i value is equal to array x of j then count_next will increment by 1.Then we use another condition that is if count_previous is greater then count_next then mode of x is decrement by 1. else mode equal to array and count_previous holds the value of count_next and count_next is equal to 0.

8 0
2 years ago
Exponentiation Is a/an operater?​
garik1379 [7]

Answer:

Yes it is

Hope this helps

5 0
1 year ago
In the process of retrieving a specific memory from a web of associations a person needs to activate one of the strands that lea
iVinArrow [24]

Answer:

Priming.

Explanation:

The brain is the centre of control for all animals. It coordinates the body system, breathing, beating of the heart, memory, gait, speech, sight etc.

Memory is stored in the brain ( the function of the cerebral cortex in the cerebrum). Two types of memory are the long term and the short term memory. The long term memory stores information permanently in the brain, while the short term holds the information for a while and either transfers it to the long term memory or the memory decays.

To retrieve a specific memory from the wide memory of the brain, it activates a strand that leads to the memory, this process is called priming.

6 0
2 years ago
Haley is helping to choose members for a customer satisfaction team. Which of the following employees demonstrate skill in focus
ivanzaharov [21]
Jesse constantly looks for better ways to solve problems for customers
7 0
2 years ago
Other questions:
  • Which of the following is true about simulation games? A. Simulation games involve competing in a sport against other players. B
    10·2 answers
  • While researching ideas for cutting energy costs is his company. Hector watches an online video in which a business expert says,
    6·2 answers
  • An organization has a datacenter manned 24 hours a day that processes highly sensitive information. The datacenter includes emai
    5·1 answer
  • George borrowed some equipment from his friend for recording his monologue for his art class. He got all the equipment except th
    15·1 answer
  • What happened if the offshore team members are not able to participate in the iterations demo due to timezone/infrastructure iss
    12·1 answer
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    6·1 answer
  • A ______________ deals with the potential for weaknesses within the existing infrastructure to be exploited.
    10·2 answers
  • Which group contains the command to manually conduct a spell check ?
    9·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
  • What should businesses do in order to remain competitive under the current Cloud<br> landscape?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!