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
densk [106]
3 years ago
12

Create a subclass of Person called Lecturer that has 2 variables of its own: employeeNumber and salary. As in the above scenario

, these variables should be declared private with the appropriate getter and setter methods to access them.
Computers and Technology
1 answer:
Ahat [919]3 years ago
4 0

Answer:

Following are the class is given below

public class Lecturer  extends Person  

{

private String employeeNumber;// private variable

private double salary;  // private variable

public String getempnumber() // getter method for employeeNumber  

{

return employeeNumber;

}

public void setempnumber(String employeeNumber) // setter method for  employeeNumber variable  

{

this.employeeNumber = employeeNumber;

}

public double getempsalary() //getter method for  salary variable  

{

{

return salary;

}

public void setempsalary(double salary)//setter method for  salary variable  

{

this.salary = salary;

}

}

Explanation:

In this program we create a subclass  Lecturer which inherit person class we declared a two private member in this class one is  employeeNumber which is String type because string can hold integer as well as characters and second is  salary  which is double type then after that we  create a setter method and getter method for both the variable .

for variable “employeeNumber”  we create a public void setempnumber(String employeeNumber) for setter method and public int getempnumber() for getter method similarly for variable “salary” we create public void setempsalary(double salary) setter method and public double getempsalary() for getter method.

You might be interested in
Suppose that a program performs an intermixed sequence of (stack) push and pop operations. The push operations put the integers
marin [14]

Answer:

c and d.

c. 0465381729

d. 4687532901

Explanation:

Once an item has been stacked on top of another item, there

is no way to pop them in a different order.

8 0
3 years ago
What is a Network-layer routing technology that enables a group of workstations to share a single registered address?
Talja [164]
Your answer is:
Network Address Translation

I hope this helps! :)
4 0
3 years ago
Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The me
NNADVOKAT [17]
I don't know what language you want it in but I will write this in Java.

public int isMultiple(int x, int y) {
    if (x % y == 0)
        return 1;
    return 0;
}

The mod function (%) returns 0 iff x divides y.
Feel free to ask me questions!
3 0
4 years ago
Read 2 more answers
Course Name Grade to Date Progress Overdue Activities
crimeas [40]

lol

i understand hi

hi hi

3 0
3 years ago
Antonio’s computer is hung up. which trio of keys should he press to restart his computer?
IgorLugansk [536]

Ctrl + Alt + Delete is the keys used by some PCs to reboot frozen computers by using task manager to kill any nonresponding applications. Another way to do this on some other is Ctrl + Shift + Esc.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which information technology job has the lowest predicted 10-year growth? computer programmer software developer computer suppor
    13·1 answer
  • Modern ancestor of the typewriter
    12·2 answers
  • Write a C# program named InchesToCentimeters that declares a named constant that holds the number of centimeters in an inch: 2.5
    14·1 answer
  • To always see the header row with scrolling through long worksheets, you would use the ______ command.
    8·1 answer
  • One of the prominent movies released in the 1950s is
    15·2 answers
  • What are the two types of formulas in excel
    9·1 answer
  • Wanda works for a large company. She and her team maintain a set of servers that support their office, and their office is conne
    12·1 answer
  • Where do charts get the data series names?
    14·1 answer
  • Which formatting options can be changed by selecting the Design tab? Check all that apply.
    7·2 answers
  • When documenting one author in reference in a text, which is correct?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!