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]
3 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]3 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
I don't know the answer and I tried different ones and they not what the book is looking for.
Serhud [2]

Answer:

The complete program is:

import java.util.Scanner;

class Main

{

public static void main (String [] args) {

int numObjects;

Scanner scnr = new Scanner(System.in);

numObjects = scnr.nextInt(); // Program will be tested with values: 15, 40.

System.out.println(numObjects);

}

}

Explanation:

The program is as mentioned above, And we can check with inputs 15, and 40. And it was found that correct answer is obtained on running the program.

3 0
3 years ago
Using information from the lesson, explain how new technologies change your experience as a consumer.
densk [106]

Technological improvements allow me to have greater access to goods around the world. I can buy instantly and communicate instantly with producers. Technology can also help me to monitor economic trends, both in my country and in my own life. In summary, technology helps to give me more freedom to make economic choices.

On e2020

6 0
3 years ago
Read 2 more answers
Tech A says that gasoline vapors are lighter than air, so inspection pits do not have a fire hazard like above ground hoists. Te
Elden [556K]

Answer:

Tech B is correct.

Explanation:

First, It is international best practice never to exceed the lifting capacity of any hoist. To do so would expose those involved to risks that may prove to be fatal.

Second, research has shown that gasoline vapors, as well as vapor from almost all other flammable or ignitable liquids or substances, are heavier than air.

More specifically, Gasoline produces flammable vapors that are heavier than air by 3 to 4 times. This means they can travel for great distances along the ground. Worst still, inspection pits are must be kept free from gas vapors because they tend to accumulate in low or enclosed spaces.

Both technicians should and must observe all occupational, health, and safety rules and guidelines stipulated and required for their industry/practice.

Cheers

4 0
2 years ago
Every information systems (is) user has the right to a secure computing environment. this means that the
Arturiano [62]
<span>Every information systems (IS) user has the right to a secure computing environment. this means that the </span>organization should protect his/her computer and its files.
5 0
3 years ago
Select the correct answer from each drop-down menu. Select the correct type of address reference.
Reika [66]

<u><em>[ Absolute ]</em></u><em> Addresses do not change if you copy them to a different cell.</em>

<u><em>[ Relative ]</em></u><em> </em><em>Addresses change depending on the cells you copy them to.</em>

8 0
2 years ago
Read 2 more answers
Other questions:
  • Describe markings on a road that indicate that it is safe to pass.
    10·1 answer
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    14·2 answers
  • What is the principal goal of data science?<br>​
    5·1 answer
  • Select one of the wrong answer from question 1 and explain why it is ironic.
    7·1 answer
  • In which of the following phases of filmmaking would a production team be focused on the
    10·2 answers
  • Does The ps5 digital have a disc drive even Though ps4 games are not compatible
    6·1 answer
  • What refers to a set of instructions executed in order?
    6·1 answer
  • Please Answer ASAP!!
    15·1 answer
  • How can i find these services
    10·1 answer
  • Which device is used to direct the flow of data on a computer network?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!