Search:

Type: Posts; User: IneedHelpwithJava

Search: Search took 0.24 seconds.

  1. Re: Help with Java program that counts strings and tallies results

    OK. Anyway thanks for the help, honestly couldn't do the rest of the code without it! :)
  2. Re: Help with Java program that counts strings and tallies results

    Sorry I usually understand examples a lot better. Could you show me an example?
  3. Re: Help with Java program that counts strings and tallies results

    Nothing really actually I just changed my code to args[count].length instead of sentence[count].length. I don't know what I was thinking having arrays with no value.

    This sounds REALLY useful! How...
  4. Re: Help with Java program that counts strings and tallies results

    Yes you're right. Both my arrays have no Strings in them which is why they don't produce any result. How would I make a new array which uses the strings from (String []args) without being called args?
  5. Re: Help with Java program that counts strings and tallies results

    Hmm ok. I'll have a think and get back to you. Maybe change some things in my code. Thanks for the help.

    --- Update ---

    Hey right now I fixed my problem of the exception out of bounds (which is...
  6. Re: Help with Java program that counts strings and tallies results

    Oh I forgot, my array is "the dog isn't first second" I can change it to anything but thats what it is at the moment. The max length is therefore the longest word, which is 6 characters. 4
    The error...
  7. Re: Help with Java program that counts strings and tallies results

    oh right.


    int anArray[] = new int[max]; //This is just a value i determined earlier that calculated the max length of the array
    int sum = 1;
    int count = 0;
    int i = 0;
    String sentence[] =...
  8. Re: Help with Java program that counts strings and tallies results

    int anArray[] = new int[max]; //This is just a value i determined earlier that calculated the max length of the array
    int sum = 1;
    int count = 0;
    int i = 0;
    String sentence[] = new...
  9. Help with Java program that counts strings and tallies results

    Basically my java program is supposed to calculate the length of each string in anArray. That isn't too much of problem HOWEVER I can't seem to figure out how to collect strings of the same length...
  10. Re: Creating Langton's Ant and I need serious help with it (it's a block that moves around on a grid changing the symbol at each index)

    Don't worry about it, it's a lost cause.
  11. Re: Creating Langton's Ant and I need serious help with it (it's a block that moves around on a grid changing the symbol at each index)

    sorry for the lateness:
    Essentially by ant moving I mean I want to shift a unique block to another index based on the symbol at that the index (ie. if it lands on a symbol * it means it should...
  12. Creating Langton's Ant and I need serious help with it (it's a block that moves around on a grid changing the symbol at each index)

    In my code there are multiple packages and methods but I will try to keep it as simple as possible.

    The grid and ant look like this:

    // prints ant and board
    System.out.print("+");
    for...
  13. What does args[i] actually mean?

    I see it often in for-loops and such, but I don't know what it really means. Help?
  14. Re: I need help explaining an OutofBounds error for a String grid I made?

    Thanks for the help, I can't believe it was that simple! :)
  15. I need help explaining an OutofBounds error for a String grid I made?

    As my username suggests I need help with a lot of things. This grid I made is one of them. I get the following error message when I run the code below:

    Exception in thread "main"...
  16. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    Sure! Hold on...


    package variables;
    public class SimpleCalc {
    public static void main(String[] args){
    int n=11;
    if (n<0){
    if (n%2); ...
  17. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    Thank you I will try this and come back

    --- Update ---

    That was helpful (i now understand the modulus operator) but I am getting problems in my code where it is not converting to boolean. See...
  18. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    I was wondering how I could go about printing a number both negative and odd using "if" statements and (I'm assuming but not entirely sure) boolean?
  19. Re: Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    Yes I can use println
  20. Beginner at Java: I need to figure out how to print a number which is odd and negative and fits in a formula.

    I am really new to java and wanted to know how I can print an int which is both negative and odd and if so, needs to be put into the formula (n^2+1) . I am not looking particularly for answers...
Results 1 to 20 of 20