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
Aloiza [94]
3 years ago
13

Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A

person has a name, address, phone number and e-mail address. A student has a class status (freshman, sophomore, junior or senior). Define the status as constant. An employee has an office, salary, and experience (number of years, integer value). A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each of the class to display the class name and the person’s name.
Computers and Technology
1 answer:
harina [27]3 years ago
3 0

Answer:

se explaination

Explanation:

//Design a class named Person

public class Person

{

//A person has a name, address, phone number, and email address.

String name;

String address;

String phone;

String email;

//Constructor with arguments

public Person(String pname,String paddress,String phNum,String pemail)

{

name=pname;

address=paddress;

phone=phNum;

email=pemail;

}

// toString() method to return the name

public String toString()

{

return getClass().getName()+" "+name;

}

}

---------------------------------------------------------

//Student.java

public class Student extends Person

{

//A student has a class status

//(freshman,sophomore, junior, or senior).

//Define the status as a constant.

final int freshman =1;

final int sophomore =2;

final int junior=3;

final int senior=4;

String status="freshman";

//Constructor with arguments

public Student(String name, String address,String phonenumber, String email, int Status)

{

super(name,address,phonenumber,email);

if(Status == 1)

{

status = "freshman";

}

if(Status == 2)

{

status = "sophomore";

}

if(Status == 3)

{

status = "junior";

}

if(Status == 4)

{

status = "Senior";

}

status = "Student";

}

public String toString()

{

return super.toString() + " " + status;

}

}

------------------------------------------------------

//Employee.java

public class Employee extends Person

{

//An employee has an office, salary, and date hired.

String office;

double salary;

java.util.Date dateHired;

//Constructor with arguments

public Employee(String name,String address,String phonenumber,String email,String off,double sal)

{

super(name,address,phonenumber,email);

office=off;

salary=sal;

}

public String toString()

{

return (super.toString() + " " + office +" " + salary);

}

}

--------------------------------------------------------

//Faculty.java

public class Faculty extends Employee

{

//A faculty member has office hours and a rank.

String officeHours;

String rank;

//Constructor with arguments

public Faculty(String name,String address,String phonenumber,String email,String off,int salary,String offHours,String ranks)

{

super(name,address,phonenumber,email,off,salary);

officeHours=offHours;

rank=ranks;

}

public String toString()

{

return (super.toString() + " " + officeHours +" " + rank);

}

}

-----------------------------------------------------------------------------

//Staff.java

public class Staff extends Employee

{

//A staff member has a title

String title;

//Constructor with arguments

public Staff(String name,String address,String phonenumber,String email,String off,int salary,String ti t)

{

super(name,address,phonenumber,email,off,salary);

title=ti t;

}

public String toString()

{

return (super.toString() + " " + title);

}

}

You might be interested in
2. Explain the difference between a JMP instruction and CALL instruction
Kobotan [32]

Explanation:

call instruction is used to call a subroutine .Subroutine are often used to perform tasks that need to be performed frequently .The JMP instruction is used to cause the PLC to skip over lugs

6 0
2 years ago
Universal Containers has two customer service contact centres and each focuses on a specific product line. Each contact centre h
allsm [11]

Answer:

B. Cross-train agents on both product lines

D. Implement a customer self-service portal

Explanation:

Cross-training is a way of teaching employees different aspects of the job so that they can have a measure of flexibility in the discharge of duties. Managers find this approach to be effective as they believe it saves cost and maximizes the usefulness of employees. It also helps to serve and satisfy a wider range of customers.

So for Universal Containers seeking to optimize cost without compromising customer satisfaction while managing two customer service contact centers, an effective way of dealing with the large call volumes is cross-training agents on both product lines so that they can attend to a wider range of customers. Cross-training agents on both product lines would make them more knowledgeable of the services being offered and this would minimize the need to transfer calls as all agents can provide information on the various products.

Implementing a customer self-service portal would also reduce the workload on the customer service agents as customers can access the information they need on their own.

7 0
2 years ago
Will mark Brainliest!! What is the best hard disk compacity? Why?
choli [55]

Answer:

The SeaGate FireCuda is the best hybrid hard drive.

Explanation:

The SeaGate FireCuda is the best hybrid hard drive on the market. It can fit up to 2TB of data, and then its 8GB of solid state cache storage learns which data you use most, so that you can access it quickly. That speed boost is even sweeter when you consider that this drive spins at 7,200rpm.

3 0
2 years ago
Microsoft word 2010 lab 6-1
icang [17]

Answer:

I ain't ever seen 2 pretty bestfriends, its always one of them that gotta be ugly  

Explanation:

5 0
2 years ago
Read 2 more answers
Why is it more secure to require a user to press ctrl+alt+delete to log on rather than displaying the windows welcome screen?
Levart [38]
Let's say for example you have a toddler, or a pet. Let's say a cat. If the ctrl+alt+delete wasn't there. It would go straight to entering the password. Now let's say your child or pet likes to press the keys for a while. If they manage to press enter and enter the incorrect password. Eventually it will lock up your computer.
5 0
3 years ago
Other questions:
  • The ___ is the primary storage device of a personal computer. hard drive RAM ROM compact disc
    6·1 answer
  • HELP I don't understand this
    14·2 answers
  • a reviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. which action ca
    8·1 answer
  • 1⁰=?<br> Is equal to...........
    12·2 answers
  • What inspired john logie baird to create the television?
    11·1 answer
  • Is badlion safe and how ?
    14·1 answer
  • How to write email abut new home your friend ​
    14·1 answer
  • Pick one of the following scenarios and
    6·1 answer
  • Helllllllllppppppppppp
    9·1 answer
  • Chris needs to modify the default bullets that are used in a nonnumbered list in Word.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!