0

Ok, I've been trying to do this for a few days, But I'm not getting it. Our Prof. is not very good, and I have no one to ask how to do this, I really need help with this.

Write a program that has an array of 5 Strings, and determines which ones are
palindromes (letter-case does not matter) .
Your code will be written in one class Palindrome.java and has a main() method.

Please note the following:
1. Do not write all your code in the main(). The main should only initialize the array, and
print the palindrome words found. You can break your problem into smaller pieces
dealt with in separate methods. For example you might need a method that determines
whether a String is a palindrome or not (What would it take as a parameter? what
would it return?)
2. You will need to use String methods (API).

All I have done so far is this, which is not complieing

import java.util.*;
/**
 * Write a description of class Palindrome here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Palindrome
{
  public static void main(String [] args) {
    ** String [] palindrome = {“civic”, “level”, “rotator”};** 

(Illegal character, last line)

    }
}

Thanks....

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by NormR1
0

Please post the full text of the error messages.

The posted code has some **s on line 11 that should not be there. Remove them.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.