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
Elena L [17]
4 years ago
14

Import java.util.ArrayList;

Computers and Technology
1 answer:
Nonamiya [84]4 years ago
3 0

Answer:

Explanation:

The following code was fixed but it is impossible to fix the entirety of the code without adjusting the Main method as well. This is because the information is being saved in an ArrayList that is saved within the main method. This means that either we need to move the Arraylist outside of the main method or adjust something inside the main method as well to make the code run. In this iteration, I have added an IF statement to the Point method so that it deletes a point if it is being added for a second time. In order to accomplish this, I had to add an extra argument when calling the Point Method in the Main method which would be the ArrayList in which the information is saved.

import java.util.ArrayList;

import java.util.List;

class PointTest {

   static final class Point {

       private double x, y;

       Point(double x, double y, List<Point> points) {

           this.x = x;

           this.y = y;

           for (int i = 0; i < points.size(); i = i+1) {

               if ((points.get(i).x == x) && (points.get(i).y == y)) {

                   points.remove(i);

               }

           }

       }

   }

   public static void main(final String[] args) {

       List<Point> pointList = new ArrayList<>();

       pointList.add(new Point(1, 2, pointList));

       pointList.add(new Point(3, 4, pointList));

       System.out.println(pointList.size());

// remove the second Point

       pointList.remove(new Point(3, 4, pointList));

       System.out.println(pointList.size());

// REMOVED!!!!!

   }

}

You might be interested in
John is runnig his Database application on a single server with 24 Gigabytes of memory and 4 processors. The system is running s
spayn [35]

Answer:

Vertical Scaling

Explanation:

Vertical scaling means the ability to increase the capacity of existing hardware or software by adding resources. In this case, more GB is added (8GB) to the server to address the problem. So vertical scaling is the resultant type john is expecting.

3 0
3 years ago
Facial recognition software can do all of the following, except: Match photos based on facial features Generate a picture based
suter [353]

Answer:

Generate a picture based on an eyewitness description

Explanation:

Facial recognition can only recognise faces it cannot generate new faces.

5 0
3 years ago
_________ analysis is a data mining application that discovers co-occurrence relationships among activities performed by specifi
SSSSS [86.1K]

<u>Affinity analysis </u>is a data mining application that discovers co-occurrence relationships among activities performed by specific individuals or groups, such as market basket analysis.

<h3>What is affinity analysis?</h3>

Affinity Analysis is a type of predictive analysis method that uses data mining to uncover hidden, insightful correlations between various variables based on how frequently they occur between distinct persons or groups in the dataset.

The Product Affinities Analysis sheds light on the items that clients buy in tandem during a shopping trip, such as how they are filling out a broader weekly shopping trip or putting together specific meals.

Therefore, Affinity analysis is a data mining tool that identifies co-occurrence patterns between tasks carried out by particular people or groups, like market basket analysis.

To learn more about affinity analysis, refer to the link:

brainly.com/question/13077215

#SPJ5

5 0
1 year ago
Read 2 more answers
The original commercial version of Ethernet supported 10 Mbps bandwidth; the version introduced in the early 1990s supports 100
Elodia [21]

Answer: a) and c).

Explanation:

  • Ethernet is a Layer 2 and also Layer 1 Technology (this layer defines the technical details of cabling and connectors), so any upgrade to a newer, faster version (like 100G Ethernet) will be possible changing only the components operating at these layers, without changing anything in the higher layers like IP and TCP, for instance.
  • This is a direct consequence of the OSI layer model foundations, that say basically that each each layer is independent from the others, so the piece of software pertaining to one layer, only interacts with his layer peer in the destination machine.
  • So, any changes to the technology used in one of the layers, don't usually affect the operation of the other layers.
3 0
3 years ago
Write an HTML document which contains two text fields, a button, and a div. The first text field should be labeled “Temperature”
disa [49]

Answer:

I created a jsfiddle for this: https://jsfiddle.net/tonb/o7uv4cdm/26/

Explanation:

see jsfiddle.

The usual html and body tags are omitted for simplicity. For your stand-alone page you'll have to put them in, as well as additional tags for your inline scripting.

5 0
4 years ago
Other questions:
  • If a domain consists of dcs that are running versions of windows server earlir than windows server 2008, what replication method
    12·1 answer
  • A type of specialty processor devoted exclusively to protecting your privacy.
    9·2 answers
  • What is the name of the interface that uses graphics as compared to a command-driven interface?
    11·1 answer
  • Given a variable s associated with a str, write an expression whose value is a str that is identical except that all the letters
    15·1 answer
  • Solid state components are less likely to fail because they:______.a. are driven by precise sets of software instructions. b. ha
    8·1 answer
  • When you are giving a presentation, which of these elements will help you to explain the content better
    9·1 answer
  • 5. How would you describe the relationship between blocks of code and commands?​
    14·2 answers
  • Give two reasons you should be aware of your computer's system components and their characteristics.
    10·1 answer
  • What is the difference between the dom api and the html dom api.
    8·1 answer
  • Taran wants to work in the technology field but is unsure of which career to pursue. He has been told he has strong people skill
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!