My computeCommission is not working because I keep getting 0.0 instead of the actual commission value
package lab4;
public abstract class Policy {
public double commission;
Type: Posts; User: Markusovich_
My computeCommission is not working because I keep getting 0.0 instead of the actual commission value
package lab4;
public abstract class Policy {
public double commission;
I want my output to look like example1, but instead it looks like example2.
Basically, I am not using any of the Java API classes such as ArrayLists or LinkedLists, as I have created my own custom linked list class which in this case is named FoodList. I am trying to figure...
How?
--- Update ---
What does shuffling have to do with removing an int from the generator?
It worked. However, I still can't remove the random integer from the generator.
--- Update ---
Please run this code
package teacher;
public class Driver {
I've tried to make an arraylist and add all possible integers, but my code gives me an error:
ArrayList<Integer> x = new ArrayList<Integer>();
x.add(0);
x.add(1);
x.add(2);
x.add(3);...
If a randomly generated number is called once, how can I exclude it so it isn't called next time?
Please run my code:
package teacher;
public class Driver {
public static void...
I replaced
public boolean equals(Player other){
return(true);
}
with
I think I got it now, thanks!
I created my equals method like this:
public boolean equals(Player other){
return(true);
}
Now it works perfectly fine.
How does the get method return a reference to an object in the list?
I created an equals method in the Player class but have not used it.
--- Update ---
This is my method when I added the...
And how can I reference an object that is already in the ArrayList?
Because there is no other way that I know of to delete an object. Is there an alternative to remove()?
I'm already using the correct method to delete the certain object though. I don't need a boolean because I already know that it doesn't work
How can I remove an object from an ArrayList? If you run my code, my delete method in the Team class does not seem to be able to remove the object that I typed from the keyboard.
the remove()...
That's the problem, it does not read the next two lines. It only reads the first line, and I want to get it to read ALL of the lines in the file. And put all of those objects into an ArrayList, so...
I did
This is my output:
details=[Simon, Markus, 0, 0, 0]
details=[]
I fixed the code to say 4 elements instead of 5.
This line only returns the first object I have in the file:
System.out.println("details="+ java.util.Arrays.toString(details));
Does...
If you look at line 95, I made the size of the array to hold 5 elements.
String[] details = new String[4];
I am working on my own personal project where you keep a record of Player objects in a file. I have created a way create a new file and add Player objects to it, or open an existing file and add...
dsgwehfdsbrsfdnfgdsnb