Search:

Type: Posts; User: Melawe

Search: Search took 0.10 seconds.

  1. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Thanks all! :)
  2. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Changed the names of the variables to something more suitable.

    class ThirteenArray {
    public static void main(String[] args){
    //Hour 9, Second activity.
    int multiply = 1;
    ...
  3. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Sorry I haven't been posted any updates. PC is acting up keeps giving a nasty "Error loading os." message. So I've been backing up and hadn't much time for coding. I did get a chance to update the...
  4. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    When I use the code below sum[0] is always being set to 0.

    class ThirteenArray {
    public static void main(String[] args){
    //Hour 9, Second activity.
    int multiply = 13;
    ...
  5. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Sorry I didn't post in about a week. Netbeans started to compile forever(at least for how long I let it), reinstalled it and it seams to be working as it should. :D
    Meanwhile I've been trying to...
  6. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Kevin I am trying to follow your advice but not understanding line 8 sum[thirteen] = multiply * thirteen; is really being a hurdle. I really don't understand that line at all, it was used in another...
  7. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Whats happening in sum[thirteen] = multiply * thirteen;? All elements in an array are numbered, so why doesn't sum[thirteen] give me an exception message or something?
  8. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Is that comment for the updated code too?
  9. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Update code:
    class ThirteenArray {
    public static void main(String[] args){
    //Hour 9, Second activity.
    int multiply = 13;
    int[] sum = new int[401];
    for(int...
  10. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    hmmm, so I have to set the highest element to 401?
  11. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Excuse that, removed it to try something and forgot to add it later on, I updated the post please take a look at it again.

    Oh and I change the for loop to the way JavaPenguin said to do it, what's...
  12. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Updated code:

    class ThirteenArray {
    public static void main(String[] args){
    //Hour 9, Second activity.
    int multiply = 13;
    int[] sum = new int[400];
    for(int...
  13. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Object.

    public class Virus {
    //Hour 11, Workshop, object.
    static int virusCount = 0;

    public Virus() {
    virusCount++;
    }
  14. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Is there any reason for Net beans to run a file and display the output with no problems? And display an error message the second time the file was run even though there were no changes made to the...
  15. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    :/ Everything I've been trying gave me an error message.
  16. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    I meant to make each element of the sum array equal to the first 400 multiples of 13.

    Instead of doing it line by line like this.

    sum[0] = 13;
    sum[1] = 26;
    sum[2] = 39;
    sum[3] = 52;
    // and...
  17. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    I see, is there a way I can make the for loop do that?
  18. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    To be honest I am not quite sure of everything that is happening. I get about everything expect line 8 to be exact. I'm just experimenting, trying to find a way that works. And when I do, understand...
  19. Replies
    39
    Views
    4,742

    [SOLVED] Re: A little assignment involving arrays.

    Changed it up a bit.

    class ThirteenArray {
    public static void main(String[] args){
    //Hour 9, Second activity.
    int multiply = 13;
    int[] sum = new int[1200];
    ...
  20. Replies
    39
    Views
    4,742

    [SOLVED] A little assignment involving arrays.

    Hello everyone. :)
    I'm having a little problem with an activity I have to do. I have to "Write a program that stores the first 400 numbers that are multiples of 13 in an array".

    My Current code:...
Results 1 to 20 of 20