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 statement best describes how the rapid prototyping model works?a) Developers create prototypes to show stakeholders how va
VashaNatasha [74]
Developers are aiming for two goals from their products. 
one is the amount of money they can make off of their production of inventions. 
and two is the effenciency of the produce. 

i would strongly have to go with a 
though im not very fond of computers and technology classes

6 0
1 year ago
Read 2 more answers
if you had two proxy servers located in the same room, what use could you make of them? nothing create a hub sell one of the ser
Anit [1.1K]
Create a free wifi service
6 0
2 years ago
Read 2 more answers
Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example
jasenka [17]

Answer:

public class Main

{

public static void main(String[] args) {

    int userNum = 40;

    while(userNum > 1){

        userNum /= 2;

        System.out.print(userNum + " ");

    }

}

}

Explanation:

*The code is in Java.

Initialize the userNum

Create a while loop that iterates while userNum is greater than 1. Inside the loop, divide the userNum by 2 and set it as userNum (same as typing userNum = userNum / 2;). Print the userNum

Basically, this loop will iterate until userNum becomes 1. It will keep dividing the userNum by 2 and print this value.

For the values that are smaller than 1 or even for 1, the program outputs nothing (Since the value is not greater than 1, the loop will not be executed).

4 0
2 years ago
What web 2.0 features allows users to subscribe to a data plan that charges for the amount of time spent on the internet?
galina1969 [7]

Answer:

The answer to this question is given in the explanation section. The correct option is long tail

Explanation:

a.Folksonomy

Folksonomy is a way of organizing data and digital content. With Web 2.0, users can collaboratively manage and tag photos, journals and other media. As more users do this, creates a system of classification for the media and information.  so this option is not correct

b. long tail (correct option)

Some sites are able to offer services as well in which users can subscribe monthly or pay a fee every so often. An example of this would be Netflix.

c.user participation

All users have the free will to contribute to the site which makes many Web 2.0 pages public. With sites such as Wikipedia, anyone is open to the editing of articles. Information is provided two-way instead of solely from the site owner.

d.application

Web 2.0 applications that allow anyone to create and share online information or material they have created. As you know that there are number of different types of web 2.0 applications including wikis, blogs, social networking, folksonomies, podcasting & content hosting services.

3 0
1 year ago
Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha
Delicious77 [7]

Answer:

Following are the program in C++ language  

#include <iostream> // header file  

using namespace std; // namespace

int main() // main function

{

   int number=0; // variable declaration

   while(number>-1) // iterating the while loop

   {

       

       cout<<"body"<<endl; // dsiplay the statement

       cin>>number; // Read the value by the user

   }

   cout<<endl<<"Done";// dsiplay the statement

   return 0;

}

Output:

body

5

body

45

body

-8

Done

Explanation:

Following are the description of the statement

  • Declared a variable "number" of int type and initialized with 0 to them
  • iterating the while loop. In this loop print the message "body" and Read the value by the user in the "number" variable. This loop will be executed repeatedly until the user do not read the negative value.
  • After the execution of the while loop, it prints the message "Done".
4 0
1 year ago
Other questions:
  • Instructions:Type the correct answer in the box. Spell all words correctly.
    5·2 answers
  • Which computer applications can Mr. Crowell use to make the classroom learning more stimulating and interesting? Mr. Crowell has
    9·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
  • Suppose that a 10-mb file is stored on a disk on the same track (track 50) in consecutive sectors. the disk arm is currently sit
    13·1 answer
  • Initialize the list short_names with strings 'Gus', 'Bob', and 'Zoe'. Sample output for the givenprogram:Gus Bob Zoeshort_names
    13·1 answer
  • Delete Prussia from country_capital. Sample output with input: 'Spain:Madrid,Togo:Lome,Prussia: Konigsberg' Prussia deleted? Yes
    13·1 answer
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each pos
    14·1 answer
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!