Thanks all! :)
Type: Posts; User: Melawe
Thanks all! :)
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;
...
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...
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;
...
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...
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...
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?
Is that comment for the updated code too?
Update code:
class ThirteenArray {
public static void main(String[] args){
//Hour 9, Second activity.
int multiply = 13;
int[] sum = new int[401];
for(int...
hmmm, so I have to set the highest element to 401?
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...
Updated code:
class ThirteenArray {
public static void main(String[] args){
//Hour 9, Second activity.
int multiply = 13;
int[] sum = new int[400];
for(int...
Object.
public class Virus {
//Hour 11, Workshop, object.
static int virusCount = 0;
public Virus() {
virusCount++;
}
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...
:/ Everything I've been trying gave me an error message.
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...
I see, is there a way I can make the for loop do that?
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...
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];
...
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:...