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
WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
padilas [110]

Answer:

BOI I got ricked rolled!

Explanation:

He done it!

5 0
3 years ago
You have a computer at home. The computer is connected to the Internet through a dial-up connection. Every time you connect to t
worty [1.4K]

Hiya!

When you connect to the internet (especially through a dial-up connection), your computer must make the request for network resources. This is usually done through a Modem, a device designed to establish and split the connection among your devices.

Fun fact; a dial up connection uses the same radio frequencies that you would use to talk on the phone; and they're in the audible spectrum. When you start up that connection, the reason all those funny noises happen is because it's "talking" to your ISP over those lines.

Hope this helps!

3 0
3 years ago
Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space.
Ksenya-84 [330]

Answer:

   while(userNum>=1){

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

       userNum--;

        }

Explanation:

This is implemented in Java programming language. Below is a complete code which prompts a user for the number, receives and stores this number in the variable userNum.

<em>import java.util.Scanner;</em>

<em>public class TestClock {</em>

<em>    public static void main(String[] args) {</em>

<em>    Scanner in = new Scanner (System.in);</em>

<em>        System.out.println("Enter the number");</em>

<em>    int userNum = in.nextInt();</em>

<em>    while(userNum>=1){</em>

<em>        System.out.print(userNum/2+" ");</em>

<em>        userNum--;</em>

<em>         }</em>

<em>    }</em>

<em>}</em>

The condition for the while statement is userNum>=1 and after each iteration we subtract 1 from the value of   userNum until reaching 1 (Hence userNum>=1)

3 0
3 years ago
6.10.1: Modify a C string parameter. Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley.
Andrej [43]

Answer:

#include <iostream>

#include <cstring>

using namespace std;

void replacePeriod(char* phrase) {

int i = 0;

while(*(phrase + i) != '\0')

{

if(*(phrase + i) == '.')

*(phrase + i) = '!';

i++;

}

}

int main() {

const int STRING_SIZE = 50;

char sentence[STRING_SIZE];

strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");

replacePeriod(sentence);

cout << "Updated sentence: " << endl;

cout << sentence << endl;

return 0;

}

Explanation:

  • Create a function called replacePeriod that takes a pointer of type char as a parameter.
  • Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
  • Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
  • Finally display the updated sentence.
6 0
3 years ago
__________ is a special place on the hard drive where items from memory can be temporarily stored for fast retrieval
andrew-mc [135]
The answer is swap file 
6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a class named Averager containing: An instance variable named sum of type integer, initialized to 0. An instance variable
    6·1 answer
  • 3. You arrive at an intersection with traffic lights that are not working because of a power outage. What do you do?
    9·1 answer
  • The most frequently applied heuristic in problem solving is a(an) _________, which involves repeated tests for differences betwe
    13·1 answer
  • Give two reasons to break up
    11·2 answers
  • Alan wants to buy camera support equipment that would provide mechanical support to his camera and which could also store extra
    5·1 answer
  • Help me, I'll mark brainiest
    12·1 answer
  • While using a web-based order form, an attacker enters an unusually large value in the Quantity field. The value he or she enter
    15·1 answer
  • Anybody know the answer to this question?
    14·1 answer
  • TensorFlow and Pytorch are examples of which type of machine learning platform?
    7·1 answer
  • Similarities between incremental and<br> prototyping models of SDLC
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!