Search:

Type: Posts; User: Melawe

Search: Search took 0.17 seconds.

  1. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Updated code.

    import java.util.Arrays;

    class BirthdaySurprise {
    public static void main(String[] args){
    // here are all the people
    byte TSE = 122;
    short LA =...
  2. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Would you mind posting the code so I can try to use the class?
  3. Replies
    46
    Views
    5,332

    Re: Array and loops.

    It's not a problem actually, I was only wondering if I could do int AL = 27/12/93; instead of int AL = 361;
    //361 being the 361st day of the year

    Did you understand me?
  4. Replies
    46
    Views
    5,332

    Re: Array and loops.

    import java.util.Arrays;

    class BirthdaySurprise {
    public static void main(String[] args){
    // here are all the people
    byte TSE = 122;
    short LA = 184;
    short...
  5. Replies
    46
    Views
    5,332

    Re: Array and loops.

    I was thinking, my code looks good so far. But it would be much much better if I could make each persons variable equal to their DOB. Is there anyway that would be possible?
  6. Replies
    46
    Views
    5,332

    Re: Array and loops.

    A bit confused there.
  7. Replies
    46
    Views
    5,332

    Re: Array and loops.

    70 and 123. Is that causing the error? Can't it hold 123 as the first element? It works when I so it this way.
    short[] aryLa = {123,124,125,126,127,128,129,130,131,132,133,134,135,136,
    ...
  8. Replies
    46
    Views
    5,332

    Re: Array and loops.

    I'm getting an error message for this loop.

    short[] aryLa = new short[70];
    for( short aryLaAdder = 123; aryLaAdder <=184;aryLaAdder++){
    //This will store each index with...
  9. Replies
    46
    Views
    5,332

    Re: Array and loops.

    import java.util.Arrays;
    class BirthdaySurprise {
    public static void main(String[] args){
    // here are all the people
    byte TSE = 122;
    short LA = 184;
    short ZE...
  10. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Printed out aryOneAddr=121 over 121 times.
  11. Replies
    46
    Views
    5,332

    Re: Array and loops.

    The array is created out of the for loop. Here is the current version of the code.

    import java.util.Arrays;
    class BirthdaySurprise {
    public static void main(String[] args){
    // here...
  12. Replies
    46
    Views
    5,332

    Re: Array and loops.

    That was the output for the Paster program, which I was using to experiment with. But the Birthday Surprise program still has 0 as the output.
  13. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Not reallyx cause the output of the BirthdaySurprise program is still 0.
  14. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Note: this is another program I use to experiment something I am not sure will work, if it works I then apply it to the main program.

    class Paster {
    public static void main(String[] args){...
  15. Replies
    46
    Views
    5,332

    Re: Array and loops.

    All elements of aryOne are equal to 0.
  16. Replies
    46
    Views
    5,332

    Re: Array and loops.

    import java.util.Arrays;
    class BirthdaySurprise {
    public static void main(String[] args){
    // here are all the people
    byte TSE = 122;
    short LA = 184;
    short ZE...
  17. Replies
    46
    Views
    5,332

    Re: Array and loops.

    What is the import statement should I use?
  18. Replies
    46
    Views
    5,332

    Re: Array and loops.

    class BirthdaySurprise {
    public static void main(String[] args){
    // here are all the people
    byte TSE = 122;
    short LA = 184;
    short ZE = 195;
    short AB...
  19. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Should I find something strange in the output of
    byte aryOneAdder;
    byte[] aryOne = new byte[123];
    for(aryOneAdder = 1; aryOneAdder <121;){
    //Now what I want to happen...
  20. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Thanks! That sure is a different way of looking at it!
  21. Replies
    46
    Views
    5,332

    Re: Array and loops.

    My guess: last time a virus messed up Netbeans I uninstalled it and re-downloaded it, but looks like some crazy files where left behind somewhere. :/ I'm planing on uninstalling all programs and...
  22. Replies
    46
    Views
    5,332

    Re: Array and loops.

    After turning of the pc for a few hours and trying again oddly the output has changed.
    Output:

    run:
    0
    BUILD SUCCESSFUL (total time: 1 second)

    Even before changing the place of the array.
  23. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Any clue to what woke up indexOutOfBounds?
  24. Replies
    46
    Views
    5,332

    Re: Array and loops.

    Like this?
    byte aryOneAdder;
    for(aryOneAdder = 1; aryOneAdder <121;){
    //Now what I want to happen here is the for loop increments aryOneAdder
    //till it's equal too...
  25. Replies
    46
    Views
    5,332

    Array and loops.

    Hello guys,
    So I decided to experiment with what I know.
    Start out with a small program then build on it till I used everything I know, with out making any mess.
    I came up with an idea of a...
Results 1 to 25 of 25