Search:

Type: Posts; User: Macgrubber

1. Thread: Help with this code

by Macgrubber
Replies
1
Views
595

Help with this code

for(row = 0 ; row < size ;row++){
result = 0;
for (col = 0 ; col < size ; col++)
result = matrix[row][col] +result;
magic = result;

sumRows[row]= result;
if...
2. Thread: help 2d array confusion

by Macgrubber
Replies
4
Views
989

Re: help 2d array confusion

result = 0;
for(row = 3 ; row >= 0; row--){
result = matrix[row][row] +result;
}
sumDiag2 = result;
if (sumDiag2 == magic){
System.out.println("Minor Diagonal = "+ sumDiag2 + ...
3. Thread: help 2d array confusion

by Macgrubber
Replies
4
Views
989

help 2d array confusion

int [] [] matrix = {
{16, 3, 2, 13},
{5, 10, 11, 8},
{2, 6, 7, 12},
{2, 15, 14, 1}
};

result = 0;

by Macgrubber
Replies
2
Views
556

oh thanks its working now...
so all i needed to do is get rid of the +" "; after the array
thank you and yeah thanks again for the advice ill be more careful next time with my practices..

and...

by Macgrubber
Replies
2
Views
556

System.out.print("\nList 2 : ");
for (i = 0 ; i<list.length ; i++){
list2 [i] =(int)(99*Math.random()+1);
System.out.printf("\n%2d",list2[i] + " ");
}

i want to display random nos. with a...

by Macgrubber
Replies
3
Views
529

Re: aligning help

it doesnt work because if a number with 1 digit comes up then the alignment will be all messed up... :( need help my instructor specifically told us to watch out for the alignments...

i think its...

by Macgrubber
Replies
3
Views
529

aligning help

System.out.print("\nList 2 : ");
for (i = 0 ; i<list.length ; i++){
list2 [i] =(int)(99*Math.random()+1);
System.out.printf(list2[i], " %2d");
}

i have this code... i want to align...
8. Thread: help with loops... :(

by Macgrubber
Replies
2
Views
1,004

help with loops... :(

im doing a for loop that goes like this.... for (i=1 , i<=30000 , i++)
ok but want to printout a result every 1000 of the time.... how to do that.. please..

by Macgrubber
Replies
8
Views
1,826

Re: Help so stumped....

o yeah thanks that was some big of a help.... :)

by Macgrubber
Replies
8
Views
1,826

Re: Help so stumped....

it works if i the 1st number i enter is positive but if you enter a negative number 1st then it has problems :(

by Macgrubber
Replies
8
Views
1,826

Re: Help so stumped....

their initialized to 0 because if the user enters the first number.. it checks the number if its <0 or >0 then it enters the loop...

by Macgrubber
Replies
8
Views
1,826

Re: Help so stumped....

so can you tell me whats wrong? i cant seem to determine... thanks i didnt realize that problem now im even more confused.... :(