Search:

Type: Posts; User: StephenCoyle

Page 1 of 2 1 2

Search: Search took 0.31 seconds.

  1. Replies
    32
    Views
    533

    Re: missing return statement need help!!

    Thanks for letting me know. I just wasn't sure and didn't want to take the chance.
  2. Re: Trimming, parsing, verifying grades entered are valid

    I understand that, you mentioned above about the grades being entered as Strings.
  3. Replies
    32
    Views
    533

    Re: missing return statement need help!!

    the typing error of Void instead of void is the problem. Your code will compile when you change it (I have BlueJ and it compiles). I don't think I could have directly told you as I have a mark...
  4. Re: Trimming, parsing, verifying grades entered are valid

    Surely you would use an integer to read in marks?
  5. Replies
    32
    Views
    533

    Re: missing return statement need help!!

    check over your code and make sure you have the basic outline for java typed out correctly. Remember that Java is case sensitive.
  6. Re: Trimming, parsing, verifying grades entered are valid

    Start with writing down the logic/algorithm for the validation.
    For example, you want the user to repeatedly enter a value until it is valid (between 0 and 100), so you would use a loop for this.
  7. Replies
    32
    Views
    533

    Re: missing return statement need help!!

    You don't seem to require a return statement for your code. You only have 1 method declared. I take it your using BlueJ. Just take a look at how you have declared your main method.
  8. Replies
    38
    Views
    451

    Re: Monthly mortgage payment calculator

    Norm is trying to help you to help yourself. You can't learn something if people just give you the answer. Especially in programming. Now look at this line off code I quoted and look at how the...
  9. Replies
    22
    Views
    341

    Re: storeing 2d array in arraylist?

    If your looking to store ints in a 2d array then print them, then dont use an array list. It seems to me by using an arraylist to store a 2d array you are over complicating the problem. The original...
  10. Replies
    38
    Views
    451

    Re: Monthly mortgage payment calculator

    PMT = (P - D)*r/12
    ______________
    (1-(1+r/12)^-m)

    Ok this is the formula. Do me a favour and post up what values you are using and the expected result.
    Also...
  11. Replies
    38
    Views
    451

    Re: Monthly mortgage payment calculator

    Even try solving the problem, using a pen and paper. Make sure that its correct. For example :
    housePrice = 30000.00
    downPayment = 5000.00

    then write it out like ( ((30000.00 - 50000.00) * ......
  12. Replies
    5
    Views
    290

    [SOLVED] Re: Array[] Size Question

    I should have mentioned that in my getFileSize method I do have a while loop and a counter. Its the counter that is returned.
    I have it working this way. Thanks for the replies.
  13. Replies
    5
    Views
    290

    [SOLVED] Re: Array[] Size Question

    Thanks. I was thinking something like that.
    What I have done now, is just created a getFileSize method that takes the file name as a parameter and returns an int (the size of the file).
  14. Replies
    5
    Views
    290

    [SOLVED] Array[] Size Question

    I have written a simple program that reads in 30 first names from a txt file into an array and 20 surnames from another txt file into another array. All I want to know is, is it possible to create an...
  15. Replies
    2
    Views
    235

    Re: need help with an assignment

    Start here - Tasks to do 1. Design solution using Step form Algorithm / flow chart.

    Using Stepwise Refinement - A way of developing a computer program by first describing general functions, then...
  16. Replies
    14
    Views
    308

    Re: Code problems! HELP :)

    Norm I use BlueJ as well for my degree and the error it gives you is 'incompatible types', then highlight in red what code its referring to.
    i.e double miles = feet * foot;
  17. Replies
    11
    Views
    193

    Re: HELP WITH METHODS!

    Your code compiles because it's syntax is correct. However as already mention

    Java Tutorials - Defining Methods
  18. Replies
    2
    Views
    215

    Re: Problem with Looping...

    ArrayIndexOutOfBoundsException - Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.
    ...
  19. Replies
    8
    Views
    325

    [SOLVED] Re: incompatible types

    required: int[]
    found: int


    Norm has shown you the resolution. And the error code tells you what the problem is.
  20. Replies
    13
    Views
    275

    Re: Array Looping

    Read and understood. Sorry.

    --- Update ---



    I should have known better.
  21. Replies
    13
    Views
    275

    Re: Array Looping

    It might help to indent your code properly. You can read it better. But anyway this is what I have been able to do :

    **** Please don't spoonfeed code
  22. Re: Why is this code giving me an ArrayIndexOutOfBoundException?

    Why are you using an array called args[0]?

    Wrap your code in the [CODE] blocks and format it so its easier to read and and understand.
  23. Re: Highschool student in need of help with array problem! Please Help!

    1 way to do this would be :



    String 1to10;

    if (num >= 1 && num <= 10)
    1to10 += "* ";
  24. Replies
    6
    Views
    236

    Re: a==b, b not initialized

    The problem has been solved by Zyrion. The problem is with the way you are trying to evaluate the if statements a==b or b==a. As Zyrion said use a==1 or b==2 to solve the problem.
  25. Replies
    6
    Views
    224

    [SOLVED] Re: If and else if statements???

    Also, there is no need for the if-else-if statement. Just use if-else. for example :

    if (hasTail)
    System.out.println("A " + name + " has a tail");
    else
    System.out.println("A " + name + "...
Results 1 to 25 of 29
Page 1 of 2 1 2