# Filling a 2d array with a,b,c problem

Page 1 of 1

## 1 Replies - 733 Views - Last Post: 09 October 2012 - 08:37 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=294986&amp;s=79542e2d15307abe984238a11fe8236f&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Portista90

Reputation: 0
• Posts: 7
• Joined: 09-October 12

# Filling a 2d array with a,b,c problem

Posted 09 October 2012 - 07:34 PM

Hey peeps! I'm new to the site and still pretty new to programming(just starting to understand more and more), but I need your help! I have this assignment for class and I cant seem to figure it out. If someone could help me that would be awesome! Thanks in advance, here is the assignment:

Palidrome Quiz

Generate (write the code) and save in an array Palidrome[250][5] all the 5 letter words using {a, b, c}

Write the code and show the execution for:

a.) Count the number of palindromes in this set.

b.) Print out all the palindromes where a letter appears more than twice.

Examples a a b a a ; b b b b b; c a c a c; a b b b a etc.

c.) Print out all the palindromes where a letter appears no more than twice.

Examples a b c b a; a c b c a etc.

Here is what I have so far(its not much and I'm not even sure if its right):
```public class palidrome {
public static void main(String args[]){

int row = 250;
int col = 5;
char [][] random= new char[250][5];
for(int i=0; i<row; i++)
for(int j=0; j<col; j++)
random[i][j]=

//String s = "atjda";

//if(s.charAt(0) == s.charAt(4)&&s.charAt(1) == s.charAt(3)){
//System.out.println("This is a palindrome");
//}else{
//System.out.println("This is not a palindrome");
//for(int counter = 0; counter >=)
//if(s.charAt(0) == s.charAt(2)|| s.charAt(1)==s.charAt(2)||s.charAt(0)==s.charAt(1)){
//System.out.println("1 :" +s);
//}else{
//System.out.println("2 :" +s);

}
}
}

```

This post has been edited by baavgai: 10 October 2012 - 04:17 AM
Reason for edit:: tagged

Is This A Good Question/Topic? 0

## Replies To: Filling a 2d array with a,b,c problem

### #2 Kinaces

Reputation: 78
• Posts: 230
• Joined: 04-October 12

## Re: Filling a 2d array with a,b,c problem

Posted 09 October 2012 - 08:37 PM

Please use code tags, and point out where you need help/what you aren't sure is working..