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
Aloiza [94]
2 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]2 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
Which organization supports professionals who assist families in making informed choices about products and services?
Naily [24]
The organisation that would best aid families and choose the right products to buy would be the American Association of Family and Consumer Sciences. In addition, the institution is primarily composed of home economists wherein these professionals promote efficient consumer consumption of goods.
6 0
2 years ago
Read 2 more answers
First, read in an input value for variable valCount. Then, read valCount integers from input and output each integer on a newlin
ratelena [41]

Answer:

The program in Python is as follows:

valCount = int(input())

reports = []

for i in range(valCount):

   num = int(input())

   reports.append(num)

   

for i in reports:

   print(i,"reports.")

Explanation:

This gets input for valCount

valCount = int(input())

This creates an empty list

reports = []

This gets valCount integer from the user

<em>for i in range(valCount):</em>

<em>    num = int(input())</em>

<em>Each input is appended to the report list</em>

<em>    reports.append(num)</em>

This iterates through the report list

for i in reports:

This prints each element of the report list followed by "reports."

   print(i,"reports.")

4 0
2 years ago
Assume the secret key is: (1, 2, 3, 4) -&gt; (3, 1, 4, 2); assume the plaintext THEYLOVEIT. If the sub-block length is 3, what i
Alex777 [14]
I belive their were answer chocies to this question am i right 

8 0
1 year ago
In C++ the declaration of floating point variables starts with the type name double, followed by the name of the variable, and t
Vadim26 [7]

Answer:

See explaination

Explanation:

Given a partial grammar which represents the specification for C++ style variable declaration. In this range a - z indicates terminals that represents the variable names.

'S' is the start symbol of the

non-terminal.

Hence, given,

S= TV

V= CX

Please kindly refer to attachment for further instructions and complete step by step solution.

8 0
2 years ago
When adopting and implementing a Software as a Service (SaaS) platform such as Salesforce for your business, which responsibilit
Greeley [361]

Answer:

Software as a service (SaaS) platform would give the client company the responsibility of offering applications over the internet, develop, host, and update the product.

Explanation:

Salesforce is an example of Software as a service (SaaS), offering applications for businesses over the internet.

Software as a Service (SaaS) uses the cloud to host web-based apps and make them available to users over the internet, eliminating the need for users to install and maintain application software. Users only access this service with an internet connection and a web browser.

8 0
1 year ago
Other questions:
  • Name and summarize the four levels of administration necessary to keep human services organization operating smoothly
    9·2 answers
  • Using information from the lesson, explain how new technologies change your experience as a consumer.
    5·2 answers
  • A class car and its subclass bmw each have a method run(), which was written by the developer as part of the class definition. i
    10·1 answer
  • An app builder has created a report for sales people to view records from the custom object, some users have complained that the
    8·1 answer
  • Which method allows a computer to react accordingly when it requests data from a server and the server takes too long to respond
    5·1 answer
  • A(n) key is the set of steps used to convert an unencrypted message into an encrypted sequence of bits that represent the messag
    9·2 answers
  • Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.
    14·1 answer
  • CHALLENGE ACTIVITY 3.7.2: Type casting: Reading and adding values.
    10·1 answer
  • Create a program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded met
    11·1 answer
  • The word “computer” has become associated with anything related to screens and keyboard. However, these are not the only parts t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!