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
alexandr1967 [171]
4 years ago
9

Assume the following two classes as Person and Working: class Person { int personID, age; String fName, middleName, lastName; ..

. // the code here is irrelevant to the question } // end of Person class class Working { int personAge; boolean isUnderEighteen(Person p) { personAge = p.age; if personAge <18 System.out.println("The person is under age and cannot work"); else System.out.println("The person can legitimately work"); } } // end of Working class
A.)What type of a coupling is provided between Person and Working classes in this design? Why?B.) What problem will this type of coupling cause?C.) Suggest a new design to fix this problem you’ve mentioned in 2B. Please write down your new code and also explain.
Computers and Technology
1 answer:
Troyanec [42]4 years ago
4 0

Answer:

A)

This is an example of tight coupling since the class Working has to have an idea of how Person is implemented to complete its own implementation.

B)

Any change in the Person class would require a change in the working class too.

C)

CODE

class Person {

int personID, age;

String fName, middleName, lastName;

public int getAge() {

return age;

}

}

// end of Person class

class Working extends Person {

boolean isUnderEighteen() {

if (super.getAge() <18) {

System.out.println("The person is under age and cannot work");

return true;

}

else {

System.out.println("The person can legitimately work");

return false;

}

}

}

Explanation:

You might be interested in
Source documents are
Bas_tet [7]

Answer:

This is the location where a document or a portion of another document was retrieved. reference: computerhope.com

3 0
3 years ago
Now that you’ve learned how to make a basic webpage using HTML and CSS, you’re going to get creative with your skills! For this
bearhunter [10]

Answer:

im trying to figure this out i will tell you when i am finished

Explanation:

I will edit it when im done

4 0
3 years ago
How do you get negative points in brainly?
Lubov Fominskaja [6]

Answer:

By spending points but not earning them.

Explanation:

You would do this by asking a lot of questions, costing you points, but not answering questions, which gains you points.

3 0
3 years ago
A farmer is going to divide her 60 acre farm between two crops. Seed for crop A costs $20 per acre. Seed for crop B costs $10 pe
Julli [10]
She would put more acres of crop b as it makes more money per acre which will give her a better investment
3 0
3 years ago
Read 2 more answers
Among the second-generation home console companies, which managed to come out on top?
marysya [2.9K]
The second generation of home consoles occurred from (1976-1988) at this time the most popular and consoled regarded as best was the Atari 2600
4 0
3 years ago
Other questions:
  • This is Tim’s first job. He is not familiar with how the Internet is used at the workplace. Match the applications of Internet u
    5·1 answer
  • Which of the following is CORRECT about database managementsystem's languages?
    6·1 answer
  • Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount
    10·1 answer
  • Given four inputs: a, b, c &amp; d, where (a, b) represents a 2-bit unsigned binary number X; and (c, d) represents a 2-bit unsi
    6·1 answer
  • An IT specialist is consulted about setting up a peer-to-peer network. What would the specialist say about security risk in this
    14·2 answers
  • Which best describes IMEI?
    5·1 answer
  • Vocabulary and Bridge Information
    6·1 answer
  • Practising some questions for board exams for class 12 python,pls help with detailed answer
    14·1 answer
  • 8. SQL, Oracle Report, and Visual Basic are all examples under the
    7·1 answer
  • 9
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!