Sunday, 8 September 2013

A boolean palindrome in Java

A boolean palindrome in Java

So I've been assigned the following problem and I don't even know where to
start. Is he wanting the palindrome's pulled from an array? All of the
research I've done online about palindrome's, none of them use boolean
values. Thanks in advance. Programming isn't my forte to say the least.
Problem 2.1. (5 points) Write a program that accepts a string of
characters terminated by a period and determines whether the string
(without the period) is a palindrome. Assume that the input contains only
letters and blanks. Assume also that the input is at most 30 characters
long. Disregard blanks when deciding if a string is a palindrome and
consider upper and lower case version of the same letter to be equivalent.
Provide a static method palindrome
public static boolean palindrome(char[] a, int number)
that accepts a char array containing the characters of the input string,
and an integer defining the number of characters in the string.

No comments:

Post a Comment