1answer.
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]
3 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]3 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
Anyone here good with PS4's?
Nookie1986 [14]
I can help you out ! What do you need to know bud ?
6 0
3 years ago
Read 2 more answers
Which of the following is generally true about Open Source Software?
JulijaS [17]
<span>Open source software is usually free to download and install, and it can be studied, changed, and distributed according to the rights of the software. I don't believe there is any copyright laws on this type of software. The most known open source software is Linux and it's available for most operating systems right now. Typically, open source owners just ask for donations for their work.</span>
3 0
3 years ago
The Cars dataset has three columns giving the quality, machining angle, and machining speed of 18 cars.
yKpoI14uk [10]

Answer:

the answer is going to be dtype

3 0
3 years ago
Good english songs to put in a power point
zheka24 [161]
Depends on what the powerpoint is about...
7 0
3 years ago
Cars made in the United States by an American-owned company are included in __________________.
Nastasia [14]
Cars made in the United States by an American-owned company are included in both the Gross Domestic Product and the Gross National Product. 
They get income while selling cars in America, and also to other countries.
3 0
3 years ago
Other questions:
  • An array UnsortedInt consists of integers in random order. Another array SortedInt consists of a sorted list of integers.
    13·1 answer
  • How did tafts accomplishments regarding conservation and trust-busting compare to roosevelt?
    11·1 answer
  • 1.Electromagnetic waves can carry more data at higher frequencies. Why would a scientist opt to transmit data at a lower frequen
    12·1 answer
  • What is the term for the instructions that tell a computer what to do
    7·1 answer
  • Pre-made, copyright-free illustrations are called __________. apps clip art graphic design stock photos
    6·1 answer
  • In general, the farther you are from other road users, the A. lower your crash risk B.higher your crash risk C. slower they are
    6·1 answer
  • A simulation system is a technology that enables you to take over a customer’s screen, mouse, or other connected device in order
    13·1 answer
  • Picture related to cyber safety
    10·2 answers
  • Janice has decided that the best approach to programming a new social media app is to start with a small portion of it by writin
    11·1 answer
  • Write a program to output 3 lines of text with the following information:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!