I don't see what is wrong i wrote it down on paper but here is the task i am trying to accomplish.
Print out a count-by-count matrix of asterisks and percent signs, alternating by row
Example:
if count = 5
output will be:
* * * * *
% % % % %
* * * * *
% % % % %
* * * * *
My Code:
int t = 1;
int k = 2;
for(int i=1; i<=count; i++){ // how many sets of for j(5) COUNT IS USER INPUT but it is not in this code
if(i == t){
for(int j=1; j<=count; j++){ //how many asterisks get printed to a line(5)
System.out.print(ast);
t+=2; // prints on odd rows
}
}
else if(i == k){ // checks when j is = to count(t)
for(int l=1; l <= count; l++){
System.out.print('%');
k*=2; // prints only on even rows
}
}
System.out.println();
}