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
In a two-sided tag, a(n) ____ tag indicates the content's end.
alexira [117]

Answer:

A closing tag

Explanation:

A tag in HTML is the core building block that marks the presence of an element. If the element has text or another element within it, it is marked using a two-sided tag and in which case, the opening tag indicates the content’s beginning and a closing tag indicates the end of the content

7 0
3 years ago
Read 2 more answers
Which of the following kinds of computing refers to an environment of servers that house and provide access to resources users a
AveGali [126]

Answer:

Cloud is the correct answer for the above question.

Explanation:

Missing Information:

    The option is missing in the question and the question suggests to choice. The option can be liberated, cloud, disperse, digital for this question in which cloud is the correct answer.

Detailed Explanation:

  • The cloud is used to store a large amount of data or information for varies users and anyone can store or modify or delete the information from anywhere.
  • This service takes money from the user and gives service to modify, edit or add the data from anywhere using the internet. When a user wants to take the service of the cloud then he needs to contact the cloud service provider, then pays money to them and then he can enjoy the service.
  • The above question wants to ask about the term which is a vast environment of databases that provide access to the users to store and mane the data and that is the cloud which is the correct answer for the above question.
7 0
3 years ago
What is an internal node?
Phantasy [73]
An internal node is a node which carries at least one child or in other words, an internal node is not a leaf node.
8 0
3 years ago
Please explain what Level 5 Automation is and give 2 examples of the technology.
arsen [322]

Level 5 ( Full Driving Automation ) Level 5 cars won't even have steering wheels or acceleration / braking pedals . They will be free from geofencing , able to go anywhere and do anything that an experienced human driver can do .

Pls follow me and Mark as brainlest!!! :-)

8 0
2 years ago
For the following code, if the input is negative, make numitemsPointer be null. Otherwise, make numitemsPointer point to numitem
weeeeeb [17]

Answer:

The program to this question can be described as follows:

Program:

#include <stdio.h> //defining header file  

int main() //defining main method

{

int* numItemsPointer; //defining pointer variable

int numItems; //defining integer variable

scanf ("%d", &numItems); //input value from user end

if(numItems < 0) //defining if block to check value

{

   numItemsPointer = NULL; //assign value to null

   printf ("Items is negative\n"); //print message

}

else //else block

{

   numItemsPointer = &numItems; //holds address

   numItems = numItems * 10; //multiple by 10

   printf("Items: %d\n", *numItemsPointer); //print value

}

return 0;

}

Output:

99

Items: 990

Explanation:

In the above program two integer variable "numItemsPointer and numItems" is defined, in which numItemsPointer is a pointer variable and numItems is integer variable, in which we input value from the user end, and an if condition statement is used, that check and calculate the values, which can be described as follows:

  • In the if block a condition is defined that variable "numItems" is less then 0, if this condition is true so, inside the block, it will assign a value, that is equal to "NULL", and prints its value.
  • If the condition is not true it will go to the else block, in this block, it will first pointer variable holds the variable address, and multiply the value by 10, and prints pointer variable value.
7 0
3 years ago
Read 2 more answers
Other questions:
  • Your brother is a video producer and is looking to buy some sort of new computing device. he needs a lot of memory and processin
    11·1 answer
  • What do you click on to minimize all open windows? the Show Desktop icon the Start menu the system tray the taskbar
    15·2 answers
  • P3. In Section 4.2 , we noted that the maximum queuing delay is (n–1)D if the switching fabric is n times faster than the input
    8·1 answer
  • In the space below, write the formula that needs to be added to the blank cells under the fourth column of the table.
    13·1 answer
  • What is wrong with each of the following?
    6·1 answer
  • Gta! ! ! !!aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    11·2 answers
  • Organizing speech ideas according to physical space, direction, or location calls for a _____ organizational pattern.
    11·1 answer
  • Question 1 (1 point)
    9·1 answer
  • Write a paragraph about ICT in personal life?
    12·1 answer
  • The international system of units is very important to our worldwide science community because it is easier for scientists to sh
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!