Search:

Type: Posts; User: floorplay

Search: Search took 0.94 seconds.

  1. Replies
    2
    Views
    200

    Re: Passing array method error

    Made a couple of silly mistakes. The working code below.

    Thanks.


    public class Methods {

    public int counts(int[] array)
    {
    int sum = 0;
  2. Replies
    2
    Views
    200

    Passing array method error

    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...
  3. Replies
    3
    Views
    611

    Re: Calculating Fuel After Distance

    Great. Thanks very much for the help Chris.
  4. Replies
    3
    Views
    611

    Calculating Fuel After Distance

    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....
  5. Replies
    4
    Views
    241

    Re: Simple Employee Class Not Passing Tests

    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...
  6. Replies
    4
    Views
    241

    Re: Simple Employee Class Not Passing Tests

    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...
  7. Replies
    4
    Views
    241

    Simple Employee Class Not Passing Tests

    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...
  8. Replies
    3
    Views
    190

    Re: Distance not being calculated properly

    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...
  9. Replies
    3
    Views
    190

    Distance not being calculated properly

    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...
  10. PlayerObject to Collide with an Array of Objects

    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...
  11. PlayerObject to Collide with an Array of Objects

    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...
Results 1 to 11 of 11