Made a couple of silly mistakes. The working code below.
Thanks.
public class Methods {
public int counts(int[] array)
{
int sum = 0;
Type: Posts; User: floorplay
Made a couple of silly mistakes. The working code below.
Thanks.
public class Methods {
public int counts(int[] array)
{
int sum = 0;
Trying to write a method that will pass an array of ints that counts the number of values that are larger than the average.
Getting an out of bounds exception for the method along with an error when...
Great. Thanks very much for the help Chris.
I'm trying to calculate the amount of petrol that is left over given a particular distance and fuel efficiency. The 'drive' method is suppose to calculate this but I'm not getting the correct output....
Seems to be working ok. Posted the main class and the output. Is there something wrong with the code you posted above?
OUTPUTS:
Employees name: Humpty Dumpty
Your account number is: 34543534...
Found what happened. When I auto generated the Setters and Getters in Eclipse the method names were identical to the instance variables and parameters!
The working class below.
* Class to...
I have written a simple Employee class that is suppose to pass the tests that have been given to us but the tests are failing and I can't see why. The methods are doing what they are suppose to be...
There are 6 classes including the Test and Main class. Yes I have all of them.
I was just hoping for some feedback on the code I had written thus far for any obvious mistakes that could be fix. At...
The first method below is suppose to calculate the distance between two objects. The second method is suppose to return true if the 'playerObject' (a single circle) and the 'barriers' (an array of...
Hi I have been given two empty methods which need to be implemented. I have done the first one, I'm pretty sure its correct but the second method 'collision' has confused me. The program itself...
Hi, two empty methods have been supplied and its my job to implement both of them. Please tell me if the first method is correct? Also the program itself consists of a 'playerObject' (a circle) which...