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
How to show neither precious nor accurate
ella [17]
When it is shining it is precious. When it is normal it is accurate.











Please make as brainliest please please
8 0
3 years ago
Technician A says that daytime running light systems illuminate the taillights to enhance visibility. Technician B says that the
musickatia [10]

I want to say Tech B

I hope this helped :D

4 0
3 years ago
5. Which of the following features of Google Groups allows users to share notes and research with
dexar [7]

Answer: C) Real-time editing

Explanation: Real-time editing is when two or more people work on thesame document live and simultaneously, this means that each user is able to work on thesame piece of document right from their individual devices at the same time with automatic and instant merging of their individual input. Google uses this feature in Google docs; which allows one to share notes and research with other users allowing them to work on the document from their individual devices live and simultaneous.

8 0
3 years ago
If i press the home button of the phone so it opens but how it opens?
aniked [119]

Answer:

by its system software

Explanation:

it is programmes by programmers like that its language is binary (0,1) so thats y when we switch it it gets to on just because that button is programmed like that if the home button wasn't on the mobile the mobile would not work it would be useless...

4 0
2 years ago
Write a program to enter a number and test if it is greater than 45.6.if the number entered is greater than 45.6 the program nee
Elina [12.6K]

Answer:

#include<stdio.h>                        //header file

int main()                                      //main function

{

float num;                                   // variable declaration

printf("Enter a number to test:\n");   // getting variable for test

scanf("%f", &num);

if (num>45.6)                                    //Testing weather greater or smaller

printf("\n %f is greater than 45.6", num);  // Result if greater

else

printf("\n %f is not greater than 45.6", num);  // Result if smaller or equal

return 0;

}

Explanation:

  • First of all , a variable will be declared in float (data type ).
  • User will input data in variable.
  • The variable will be compared using logical operator with 45.6
  • If it is greater, A phrase will be passed that number is greater than 45.6
  • Else if the number will not greater the phrase will say that the number is not greater than 45.6

4 0
2 years ago
Other questions:
  • The only requirement of __________ is that the sender must provide some mechanism whereby the receiver can opt out of future ema
    14·1 answer
  • Which option of the AutoCorrect tool enables you to add and delete words that do not follow abbreviation rules?
    12·1 answer
  • Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
    9·1 answer
  • Which of the following tasks would least help an individual achieve a goal to safely lose weight?
    6·2 answers
  • On laptops, wireless cards tend to be attached to which panel?
    8·1 answer
  • True or False. When used with the cout object, the endl stream manipulator advances the cursor to the next line on the computer
    6·1 answer
  • What is a device that connects to the system unit and is controlled by the processor in the computer called !
    15·1 answer
  • In order to create strong neural networks (connections) in your brain, you've got to __________ the learning process.
    14·1 answer
  • The Python print function
    9·1 answer
  • 2. The factorial of a positive integer n is the product of the integers from 1 to n. You can express the factorial of a positive
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!