Question: can i get help with this one please. here is the starter class public class Quadrotor { private int x; private int y; private int

can i get help with this one please. here is the starter class

public class Quadrotor { private int x; private int y; private int z;

public Quadrotor(int x, int y, int z) { this.x = x; this.y = y; this.z = z; }

public int getX() { return x; }

public void setX(int x) { this.x = x; }

public int getY() { return y; }

public void setY(int y) { this.y = y; }

public int getZ() { return z; }

public void setZ(int z) { this.z = z; }

@Override public String toString() { return "QR:" + x + "/" + y + "/" + z; }

@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + x; result = prime * result + y; result = prime * result + z; return result; }

@Override public boolean equals(Object obj) { if (!(obj instanceof Quadrotor)) return false; Quadrotor other = (Quadrotor) obj; if (x == other.x && y == other.y && z == other.z) return true; return false; }

}

And what i've got so far

public class QuadrotorApp { public static void main(String[] args){ List rotors = Arrays.asList( new Quadrotor(2,4,2), new Quadrotor(3,4,4), new Quadrotor(4,4,6), new Quadrotor(5,4,2), new Quadrotor(6,4,4), new Quadrotor(7,4,6)); System.out.println(rotors.toString()); } }

can i get help with this one please. here is the starter

What is a Quadrotor? Checkout this video Download Quadrotor java In the same directorycreate a file called QuadrotorApp. Itincludes the main method In main do e following Create a List of Quadrotors and initialize it with 6quadrotors like this: List rotors Arrays .as List new Quadrotor (2, 4, 2), new Quadrotor(3, 4, 4), new Quadro tor (4, 4, 6) new Quadrotor (5, 4, 2), new Quadrotor (6 4, 4), new Quadrotor (7, 4, 6) Prin the list (List has an overridden toString method Compile-run Write a private staticmethod called changeorientation. t has one parameter of type List does Change the initialization of the variable rotors by creatingan ArayList ke this List Quadrotor rotors new Array List (Arrays. asList new Quadrotor (2, 4, 2), new Quadrotor(3, 4, 4), new Quadro tor (4, 4, 6) new Quadrotor (5 4, 2), new Quadrotor (6, 4, 4), new Quadro tor (7, 4, 6))) Remove searchltem and pri nt the list New position Remove the item onindex 0and prin the list output: [QR: 2/4/2, QR: 3/4/4, QR: 4/4/6, QR:5/4/2, QR 6/4/4, QR 4/6] original position [QR: 4/2/2, QR: 4/3/4, QR:4/4/6, QR:4/5/2, QR:4/6/4, QR:4/7/6] rotors does contain QR :4/6/4 Number of rotors [QR 4/2/2, QR: 4/3/4, QR: 4/4/6, QR:4/5/2, QR: 4/7/6] [QR :4/3/4, QR :4/4/6, QR 4/5/2, QR :4/7/6]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!