They are already connected!
Look in the DogDriver class and you will see it creates a DogTrack and calls on its constructor and method playgame():
DogTrack d = new DogTrack(trackSize); ...
Type: Posts; User: koder632417
They are already connected!
Look in the DogDriver class and you will see it creates a DogTrack and calls on its constructor and method playgame():
DogTrack d = new DogTrack(trackSize); ...
We are all still learning. No worries!
So is it SOLVED, or were you still having issues?
I second what Greg said. Check out the link that he posted. The first page alone should give you enough information on how you need to define your constructor.
A constructor looks like a method,...
If you look inside your customer class you will see a comment:
// Add constructor, get, set, as needed.
So it looks like you are supposed to write code here. The error exists because the code...
I have an iPhone and use an app called JVM....something something. All I know is it starts with JVM. Maybe you can search for JVM instead?
I would think that the app you are using would allow you to run (test) your code.
If not there are definitely apps out there for compiling and running java, however, they aren't as robust as...
Your dogTrack class does not know of the main classes trackSize variable, meaning it is out of scope as Greg had said.
So, yes you have to declare the variable inside the dogTrack class.
The...
Okay few things I noticed,
pay close attention to your brackets {}
you will never reach this statement
if (count>10)
because it is inside of
arr[] refers to an array.
arr[i] refers to the element at index i in arr[],
so if arr[] were a String array, arr[i] would be referring to a String
Could you explain what the problem is? What is the expected result and what result are you getting?
A few things I noticed to get rid of some of the errors:
In your class DogTrack, you have a method called "playGame()". In that method you call other methods inside the DogTrack class.
If you...
There is no need to use two parameters in the method because they are both doing the same thing and don't interact. Just use one and call it twice.
public BigInteger CalculateKey(BigInteger...
It doesn't compile because you have two parameters but dont tell the compiler what type they are.
public BigInteger CalculateKey(userA, userB) {
You need to tell the compiler what type userA...
Come up with some sort of class you want to use. Maybe an Animal.
Then try to figure out how you can relate those terms to the program.
You could have a Fish class that extends the Animal class....
Couldn't you just create an array for each player, then iterate throught the main array, alternating between the player arrays and assigning them hands?
What do you have so far? Can you post what you have coded already?
Sometimes the best thing to do is take a break, but it can be difficult to do when you know the answer is going to be something so simple!
No problem. Glad I could help.
Just a tip: This was a little difficult to understand because calculations are happening in different places (which is why I was confused about the first part)...
Actually, at 100 it should be 50% off right? which would make that correct..
--- Update ---
But for others it is wrong, so you are right, you do want to go back and return discount for...
And it seems that your getCost method should look more like:
cost = costBeforeDiscount - discount;
return cost;
So what exactly is the problem? I am not sure exactly what it is supposed to do so I can't tell what is wrong.
--- Update ---
I noticed your getDiscount method returns the variable discount,...
You have an extra "=" in the for loop. Should be "!=" not "!=="
Here is the Java Docs for Operators: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html