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
It is necessary tto save updates often when working in google docs? True or false
borishaifa [10]
True cause sometimes it can delete all ur work
7 0
3 years ago
Read 2 more answers
How can netiquette help you communicate when texting or instant messaging?
Yanka [14]

1. D

2. C

it allows citizens to submit anonymous tips to the police

5 0
3 years ago
2.5 code practice I need answers please
Leni [432]

Answer:

import random

a = random.randint(1,10)

b = random.randint(1,10)

answer = a * b

print (str(a) + " X " + str(b) + " = " + str(answer))

Explanation:

Happy to help you mate

7 0
4 years ago
When we add suffix L to a integer it is called as __________​
IRISSAK [1]

Answer:

Long integer literal.

Explanation:

Integer literal can be defined as numbers that do not contain any decimal point or augmented part. An integer literals can be characterized as decimal, octal, or hexadecimal constant. When an integer liteal is added with prefix it tends to define its base, whereas suffix define its type.

The suffix L to an integer literal means long integer literal. The suffix can be written in any form, either upper case (L) or lower case (l).

Therefore, the correct answer is long integer literal.

5 0
3 years ago
Why did some people not like the arrival of machines?
Ahat [919]
People are concerned about losing their jobs. The industrial revolution introduced machines that removed the need for humans to be involved in highly repetitive tasks.
3 0
4 years ago
Other questions:
  • The set of appearance choices for files and folders is known as the
    7·1 answer
  • In C++ Please:
    11·1 answer
  • Think back over the information presented in the lesson about how you can skillfully use the Internet when doing research. Selec
    14·1 answer
  • Memory is the place of the computer where data and instructions are stored either permanently or temporarily. True or false.​
    11·1 answer
  • Proofreaders' marks are:
    6·1 answer
  • Name two different ways you can bring up the my computer folder
    9·2 answers
  • There are two circular grounds Ground-A and Ground-B. Ground-A is having diameter of 15 meters and Ground-B is having diameter o
    7·1 answer
  • A small _____ at the lower right corner of a tool indicates that it contains hidden tools​
    13·2 answers
  • CIS261: Python Programming I home<br>&gt;<br>6.8: LAB: Miles to track laps
    13·1 answer
  • What is the factor of 200
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!