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
You can tell when an image is selected, because its sizing handles will be visible. True or False
Ivenika [448]

This is true because you can go and check yourself in Word and you can click on an image and the sizing handles will appear.

hope that helps :)

8 0
4 years ago
Read 2 more answers
____ uses markup to define the structure and layout of a web document.
cupoosta [38]
HTML: Hyper Text Markup Language.

HTML is the markup language used for defining the structure, and very basics of a web page - one wouldn't be possible without this language!

HTML is combined with CSS (Cascading Style Sheet) to improve visuals, and combined with a language such as Javascript to add functionality and interaction with the web page.
8 0
4 years ago
When an interviewer asks "tell me about yourself", you should tell them about your childhood past. please select the best answer
Yanka [14]

In the interview when the candidate is asked about yourself then telling about childhood past is not correct. Therefore the given statement is false.

<h3>What is an interview?</h3>

An interview is an interaction or a conversation between an employer and the interested candidate. In the conversation the interviewee is asked about their education, family background, and work experiences.

When an interviewer ask about tell me about yourself, then the interviewee should not tell about their childhood past, rather the interviewee should give few information about their family, education, and working.

Therefore, the given statement is false.

Learn more about interview, here:

brainly.com/question/13073622

#SPJ1

7 0
2 years ago
Hajar needs to copy files on a Linux system. What command can she use to create a new copy of a file in a different location whi
Galina-37 [17]

Answer:

cp command

Explanation:

When copying files and directories under a Linux operating systems, we usually make use of the cp command . In Linux, this cp command is the one that is entered in a shell to copy a file from one location to another, and also possibly on another different file system.

8 0
3 years ago
T F Static local variables are not destroyed when a function returns.
Virty [35]

Answer:

False

Explanation:

Static local variables are destroyed when a function returns.

They are always destroyed after a function returns.

5 0
3 years ago
Other questions:
  • Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the bat
    12·1 answer
  • Write an expression that evaluates to 1 more than the value in the location pointed to by the integer pointer variable ip. Thus,
    8·1 answer
  • Fedora operating system
    9·1 answer
  • A web ______ is a computer that delivers requested webpages to your computer or mobile device.
    7·1 answer
  • Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
    6·2 answers
  • What caused accident? into passive voice​
    13·1 answer
  • Select all of the reasons Windows 95 increased the popularity of Windows.
    12·1 answer
  • What is the difference of using Selection Tool and Direct Selection Tool?
    6·1 answer
  • 3. Special keys labelled Fl to F12.
    8·1 answer
  • I need help NOW with my java script!! 1. What will the code below output to the console and why? const person = {
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!